a LEFT JOIN should do the trick

something like this:

SELECT users.user_id 
FROM users 
LEFT JOIN comps_users_link ON
(users.user_id=comps_users_link.user_id)
WHERE comps_users_link.computer_id IS NULL


olinux


--- Brad Tilley wrote:
> Three tables:
> 
> computers     (Describes computers)
> users                 (Describes users)
> comp-user-link                (Links users to computers in a 1
> user to many computers 
> relationship)
> 
> Could someone offer advice on how to construct a
> select statement to 
> show which users aren't in the comp-user-link table?
> Sort of the reverse 
> of this:
> 
> select * from comp-user-link, users where
> users.user_id = 
> comps_users_link.user_id
> 
> Basically, I'm trying to see which users aren't
> currently linked to a 
> computer.
> 
> As always,
> 
> Thanks!
> 


        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to