Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique by set - How to get resultset

Status
Not open for further replies.

vnad

MIS
Nov 22, 2002
91
US
So I have a problem that I don't think is too rare but having a brain fart.

So I have multiple sets of data.

Id1 Id2 Column1
1 2 A
1 2 B
1 2 C
1 3 A
1 3 B
1 3 C
1 4 A
1 4 D
1 4 E

So I have a 1 unique set of id1=1 with A, B, C and another uniquie set of id1=1 with A,D,E. How would I take the above result set and get the following result set


Id1 Column1
1 A
1 B
1 C
1 A
1 D
1 E

Since Id2 = 3 is not unique since there is already a set there with A,B,C.

Let me know if I am not explaining this clearly.
 
Let me try this again. I have the following table with the following data.

Id1 Id2 Column1
1 2 A
1 2 B
1 2 C
1 3 A
1 3 B
1 3 C
1 4 A
1 4 D
1 4 E

The data is unique by having the groups of data. So for Id1 = 1, there is two unique sets of data, A,B,C and A,D,E. So what I am looking for is the following data set from the above dataset.

Id1 Column1
1 A
1 B
1 C
1 A
1 D
1 E

So basically, I have to determine how to pull unique sets of rows out of a table based off id2 which is the determinate for groups.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top