Getting unique, but different rows
Posted: Wed Oct 25, 2006 6:24 am
Ok, this really has be boggled. I am trying to return rows which have unique characteristics, but whose row is not wholely unique.
For example, this is the database:
In this example the query should pick out ID's #3, 4, 6, 7. This is because they have the same phone, but different names.
One name should have one or more unique phones. Two or more names should not have the same phone.
So, the phone should be unique to the name basically.
Anyone have any ideas about how to implement this? I am completely stuck on even where to begin :/
Thanks,
someberry
For example, this is the database:
Code: Select all
id | name | phone
---------------------------
1 John 12345
2 Bob 23456
3 John 45678
4 Bob 45678
5 Bob 45678
6 Bill 56789
7 Bob 56789One name should have one or more unique phones. Two or more names should not have the same phone.
So, the phone should be unique to the name basically.
Anyone have any ideas about how to implement this? I am completely stuck on even where to begin :/
Thanks,
someberry