Hi all
I have two tables: Person and CompanyContacts. There are multiple Person fk's stored in CompanyContacts. For selecting unique entries of PersonID in CompanyContacts I was trying to do it in the following way:
However, the result of the query is not unique, even though the part in the brackets results in the unique selection.
Any workaround would be appreciated.
Cheers,
p.
I have two tables: Person and CompanyContacts. There are multiple Person fk's stored in CompanyContacts. For selecting unique entries of PersonID in CompanyContacts I was trying to do it in the following way:
Code:
Select * FROM CompanyContacts WHERE CompanyContacts.PersonID IN
( SELECT DISTINCT CompanyContacts.PersonID FROM CompanyContacts)
Any workaround would be appreciated.
Cheers,
p.