SQL SELECT statement opposite to the one here.
Posted on 2004-04-28
Apologies for the poor question title.
I have three tables:
Tbl_AddressBook has these fields:
FirstName (text e.g. Alex)
LastName (text e.g. Harris)
Tbl_Groups has these fields:
GroupName (text e.g. Clients)
Tbl_GroupLinks has these fields:
Each member of the address book may or may not belong to a group. They may belong to many groups, but only belong to the same group once.
I have created the following query to display the members of a particular group:
SELECT Tbl_Groups.GroupName, Tbl_AddressBook.FirstName, Tbl_AddressBook.LastName
FROM (Tbl_GroupLinks INNER JOIN Tbl_AddressBook ON Tbl_GroupLinks.ContactID=Tbl_AddressBook.ContactID) INNER JOIN Tbl_Groups ON Tbl_GroupLinks.GroupID=Tbl_Groups.GroupID
What I require is the opposite of this, a query which displays all the members of Tbl_AddressBook that are not in Tbl_GroupLinks.GroupID=1.
Please help me to solve this. I am sure that for an expert this is relatively simple.