Victor, Thursday, October 10, 2002, 2:21:44 PM, you wrote: VK> I have two tables, one for user details and another to indicate VK> membership of some team. The later has user_id and team_id. I VK> want to select all users that are NOT in a particular team.
VK> After a lot of effort (my sql skills are almost no existent) I VK> have the following that works with Oracle. VK> SELECT u.uname FROM users u VK> WHERE NOT EXISTS (SELECT * FROM team_members VK> WHERE team_id = 7 AND user_id=u.user_id); VK> This doesn't work with MySQL :-( VK> Can anyone help me? Ideally I would like something that would VK> be portable to oracle/sql server. Efficiency is not an issue. Check the menual: http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html You can find an example of a query there. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php