Using T-SQL, how would I extract the unique sets from a table using SQL. Here is a sample table:
ID Value
1 A
1 B
1 C
2 A
2 B
2 C
3 D
3 E
4 D
4 E
5 X
5 Y
5 Z
6 Q
7 Q
8 Q
9 Q
10 A
In this case, the desired result set would have five unique sets as follows:
A
B
C
D
E
X
Y
Z
Q
A
This is representative of incoming data that I must transform. The incoming data has hundreds of repetitive sets like this. There is substantial value in identifying these sets; putting them into a separate table; assigning them a SetID; and then associating the core data to the relevant set based on a SetID JOIN; etc.