sql select the distinct of 2 column pair

BankyEdwards

New Member
Let's say that I have 2 columns:\[code\]_______________| id1 | id2 ||------|------|| 1 | 2 || 2 | 1 || 3 | 4 || 4 | 1 || 4 | 3 || 1 | 4 | ...\[/code\]If I have a row id1 = 1 and id2 = 2, there will be a row somewhere after it which will be id1 = 2 and id2 = 1.How can I get the top of each (id1, id2) pair?Update:The result from the example should be:\[code\]row1: 1 | 2row2: 3 | 4row3: 4 | 1\[/code\]
 
Top