|
-
October 29th, 2004, 07:32 AM
#1
Registered User
SQL query-help needed!
Given MYSQL tables:
groups (groupid, groupname)
groupmembers (index, groupid, userid)
groupmembers contains pairs of groupid, userid
any userid can be paired with several groupid values
any groupid can be paired with several userid values
I need a query that will return all groups.groupname that a userid is NOT part of.
Tried this:
select distinct groups.groupname, groups.groupid
from groups, groupmembers
where groupmembers.userid='$userid'
and groupmembers.group<>groups.groupid
but it also returns groups that $userid is part of
Any idea how to do it?
Similar Threads
-
By TechZ in forum Other Software Applications
Replies: 0
Last Post: August 11th, 2004, 03:34 PM
-
By amyb in forum Microsoft Office
Replies: 2
Last Post: July 12th, 2004, 05:50 PM
-
By Nuce007 in forum Programming And Web Design
Replies: 3
Last Post: July 9th, 2004, 06:15 AM
-
By elhit in forum Tech-To-Tech
Replies: 1
Last Post: April 20th, 2001, 04:15 AM
-
By elhit in forum Programming And Web Design
Replies: 10
Last Post: March 27th, 2001, 07:30 AM
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
|
|
Bookmarks