List:General Discussion« Previous MessageNext Message »
From:Adolfo Bello Date:December 9 2002 6:08pm
Subject:RE: help on NOT EXISTS SQL query
View as plain text  
SELECT * FROM table1 t1 LEFT OUTER JOIN table2 t2 ON t1.field1=t2.field2
WHERE t2.field2 IS NULL

> -----Original Message-----
> From: murad@stripped 
> [mailto:murad@stripped] On Behalf Of Murad Nayal
> Sent: Monday, December 09, 2002 11:38 AM
> To: MySQL List
> Subject: help on NOT EXISTS SQL query
> 
> 
> 
> 
> Hello all,
> 
> I need to run query like (in mysql < ver.4):
> 
> select * from table1 as t1 where not exists (select NULL from 
> table2 as t2 where t1.field1 = t2.field1)
> 
> I know you can emulate an 'exists' subquery with a join. but 
> I just can't think of a way to emulate a 'not exists' without 
> a subquery. probably due to my limited sql experience. any hints?
> 
> thanks a lot
> Murad
> 
> BTW: when do you think mysql 4.1 would be stable enough for 
> robust use (not necessarily mission critical).
> 
> ---------------------------------------------------------------------
> 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 <mysql-thread127012@stripped>
> To unsubscribe, e-mail 
> <mysql-unsubscribe-adolfobello=bisapi.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 
> 

Thread
help on NOT EXISTS SQL queryMurad Nayal9 Dec
  • RE: help on NOT EXISTS SQL queryAdolfo Bello9 Dec
    • Re: help on NOT EXISTS SQL queryMurad Nayal10 Dec
    • Multiple MySQL db's on one machinetmb10 Dec
      • Re: Multiple MySQL db's on one machinePaul DuBois10 Dec
        • Re: Multiple MySQL db's on one machineMichael T. Babcock10 Dec
    • Multiple MySQL db's on one machinetmb10 Dec
    • Re: help on NOT EXISTS SQL queryMurad Nayal10 Dec
  • Re: help on NOT EXISTS SQL queryMurad Nayal10 Dec
  • Re: help on NOT EXISTS SQL queryiConnect \(Berlin\) Stefan Hinz10 Dec
Re: Multiple MySQL db's on one machineJan Steinman10 Dec