RE: Re: Alternative for NOT EXISTS

2002-10-11 Thread Victor Kirk
SELECT u.uname FROM users u WHERE NOT EXISTS (SELECT * FROM team_members=20 WHERE team_id =3D 7 AND user_id=3Du.user_id); It sounds to me like you are trying to ask the database: Tell me all the users that aren't in team 7. Yes. If so, this should work:

Alternative for NOT EXISTS

2002-10-10 Thread Victor Kirk
Hi, I have two tables, one for user details and another to indicate membership of some team. The later has user_id and team_id. I want to select all users that are NOT in a particular team. After a lot of effort (my sql skills are almost no existent) I have the following that works with

RE: Alternative for NOT EXISTS

2002-10-10 Thread Victor Kirk
I have two tables, one for user details and another to indicate membership of some team. The later has user_id and team_id. I want to select all users that are NOT in a particular team. After a lot of effort (my sql skills are almost no existent) I have the following that works with