Andy Jefferson <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm using MySQL 4.0.15 and have been trying to use EXISTS/NOT EXISTS ...
> with no success - getting "You have an error in your SQL syntax".
> 
> I've got 2 tables A and B and am trying something like this
> 
> SELECT THIS.A_ID FROM A THIS 
> WHERE NOT EXISTS 
> (SELECT THIS_ITEMS.B_ID FROM B THIS_ITEMS WHERE THIS.A_ID=B.A_ID)
> 
> Does EXISTS exist in 4.0.15 ? or is it introduced in 4.1.*. If it does
> exist, what is incorrect in the syntax above ? (it matches the MySQL manual
> example from what I can see). 
> 

EXISTS is supported from 4.1.
In 4.0.x you can rewrite your query using LEFT JOIN:
        http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html



-- 
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




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to