Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Selecting unique column values for a specific key field.

$
0
0

I have the following table where col2 might have the same or different values and col1 is the key field.  How can I select only the rows where col2 is different for col1 (like I have in the second table)?

col1col2
1B
1B
1B
2C
3A
3D
3D
3H
4E
5F
5G
5I
col1col2
3A
3D
3H
5F
5G
5I


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>