List:General Discussion« Previous MessageNext Message »
From:Walt Weaver Date:February 6 2004 10:26pm
Subject:RE: A challenge I think
View as plain text  
Or use an outer join with "where members.list_id is null", as was
mentioned on the list earlier today.

--Walt

> -----Original Message-----
> From: Martijn Tonies [mailto:m.tonies@stripped] 
> Sent: Friday, February 06, 2004 3:18 PM
> To: mysql@stripped
> Subject: Re: A challenge I think
> 
> 
> Hi,
> 
> > Using MySQL 4x
> > I have two tables
> > Lists and members
> > Now for every list that a member is a member of there is  
> list ID in the
> > members table so to query a members lists I would do the following
> > SELECT members.EmailAddr, members.ListID
> >
> > FROM members INNER JOIN lists ON members.ListID = lists.ListID
> > WHERE (((members.EmailAddr)="john_berman@stripped"));
> 
> Loose the parenthesis - no need.
> 
> > So I get say
> > John_berman@blueyonder 3
> > John_berman@blueyonder 2
> > John_berman@blueyonder 44
> >
> > And it works fine, but now I want to find which lists I'm 
> not a member of
> > and would appreciate some help.
> 
> select l.listid from lists l where l.listid not in (select 
> m.listid from
> members m
> where m.emailaddr = 'john_berman@stripped')
> 
> With regards,
> 
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, 
> MySQL & MS SQL
> Server.
> Upscene Productions
> http://www.upscene.com
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?> unsub=wweaver@stripped
> 
> 
> 
Thread
A challenge I thinkJohn Berman6 Feb
  • Re: A challenge I thinkMartijn Tonies6 Feb
    • iterating through a monthScott Haneda6 Feb
      • Re: iterating through a monthPeter Brawley7 Feb
        • Re: iterating through a monthmos7 Feb
      • AW: iterating through a monthFreddie Sorensen7 Feb
    • RE: A challenge I thinkJohn Berman7 Feb
RE: A challenge I thinkWalt Weaver6 Feb
Re: iterating through a monthmos10 Feb