List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 10 2002 4:23pm
Subject:Re: Alternative for NOT EXISTS
View as plain text  
At 12:21 +0100 10/10/02, Victor Kirk wrote:
>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 Oracle.
>
>SELECT u.uname FROM users u
>   WHERE NOT EXISTS (SELECT * FROM team_members
>                       WHERE team_id = 7 AND user_id=u.user_id);
>
>This doesn't work with MySQL :-(

... until MySQL 4.1. :-)

Now available for testing:

http://www.mysql.com/doc/en/Installing_source_tree.html

>
>Can anyone help me?  Ideally I would like something that would
>be portable to oracle/sql server.  Efficiency is not an issue.
>
>Vic
>--

Thread
Alternative for NOT EXISTSVictor Kirk10 Oct
  • Re: Alternative for NOT EXISTSPeter Brawley10 Oct
  • re: Alternative for NOT EXISTSEgor Egorov10 Oct
  • Re: Alternative for NOT EXISTSJohn Ragan11 Oct
    • Re: Alternative for NOT EXISTSMichael T. Babcock11 Oct
      • Re: Alternative for NOT EXISTSPaul DuBois12 Oct
        • Re: Alternative for NOT EXISTSJohn Ragan12 Oct
  • Re: Alternative for NOT EXISTSJohn Ragan11 Oct
RE: Alternative for NOT EXISTSVictor Kirk10 Oct
  • RE: Alternative for NOT EXISTSRobert Citek10 Oct
  • RE: Alternative for NOT EXISTSJan Muszynski10 Oct
Re: Alternative for NOT EXISTSPaul DuBois10 Oct