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:
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
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