-
please help its driving me nuts
Please can some 1 help me
I have 3 tables
1 with contacts in
1 with groups in
and 1 to link the 2 together
each contact and group have id's which are used in the link table
i need 2 sql queries
1 saying which contacts are in each group (i think ive cracked this)
and 1 saying which contacts are not in each group(which i need help)
Some 1 please help its driving me nuts
-
Use NOT EXISTS
Minkle,
Now this one was fun...
Try
SELECT C.ContactName, G.GroupName
FROM Contacts as C, Groups as G
WHERE NOT EXISTS (
SELECT CG.ContactID, CG.GroupID
FROM ContactGroups as CG
WHERE CG.GroupID = G.GroupID AND
C.ContactID = CG.ContactID)
HTH,
Peter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|