Question about finding composite non-unique columns
477011Dec 23 2005 — edited Dec 27 2005I am a fairly new Oracle student and recently was racking my brain over this issue:
Lets say I have a table like this:
KEY A B
1 1 1 <--
2 1 1 <-- Non-Unique Combination
3 1 2
4 2 2 <--
5 2 2 <-- Non-Unique Combination
What I want to do is locate one of the KEYs where the combination of A and B are not unique (and delete one of the rows but dont sweat that now). In this case the solution would be KEY 2 (or 1) and KEY 4 (or 5). Basically the output I would like to get is something along the lines of:
KEY
2
5
Any ideas on how I can swing this? (Sorry about the table formatting, any tips on how to better represent data on these forums? I have noticed some people manage to post beautiful tables on here, just not sure how.)