Bug #2616 Using WHERE NOT EXISTS Generates a SQL Execution Error
Submitted: 2 Feb 2004 11:50 Modified: 2 Feb 2004 12:41
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.17 OS:Windows (Windows 2003 Server)
Assigned to: Dean Ellis CPU Architecture:Any

[2 Feb 2004 11:50] [ name withheld ]
Description:
I am trying to use a SQL query to select records that exist in one table and not in another. When using the SQL query below I get an error message that says "You have an error in your SQL syntax near 'EXISTS (SELECT * FROM posts_text WHERE posts_text.post_id = ". I have tried many variations of this query and get the same results every time.

How to repeat:
SELECT * FROM posts
WHERE NOT EXISTS (SELECT * FROM posts_text
WHERE posts_text.post_id = posts.post_id);
[2 Feb 2004 12:41] Dean Ellis
4.0 does not have any support for this query.  You need to use 4.1 for this.