Dear Murad, > 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?
You have probably tried something like SELECT ... WHERE <condition> IS NOT NULL. To emulate a "not exists" subselect, you would use SELECT ... WHERE <condition> IS NULL. > BTW: when do you think mysql 4.1 would be stable enough for robust use As I hear, MySQL 4.1-alpha will be released very soon, probably in January. My guess for MySQL 4.1-gamma (the release declared as stable, meaning there are lots of installations in production environments that have proven stable) is August 2003. Any other guesses? Monty? ;-) Regards, -- Stefan Hinz <[EMAIL PROTECTED]> CEO / Geschäftsleitung iConnect GmbH <http://iConnect.de> Heesestr. 6, 12169 Berlin (Germany) Telefon: +49 30 7970948-0 Fax: +49 30 7970948-3 ----- Original Message ----- From: "Murad Nayal" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 4:37 PM 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 <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- 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