If you are using a version that supports sub-selects you could perform a
subquery.
Otherwise,the solution depends on your primary keys.
SELECT u.*
FROM users u
LEFT OUTER JOIN
comp-user-link c
ON u.userID = c.userID
WHERE c.userID IS NULL

-----Original Message-----
From: Brad Tilley
To: [EMAIL PROTECTED]
Sent: 5/25/04 1:39 PM
Subject: Search for relationships that aren't present

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!

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

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

Reply via email to