You are using a subquery. Subqueries are only supported in version 4.1 and later. You will eithe rneed to rewrite your query so that it doesn't use a subquery, or upgrade.
Cheers Andrew. ----- Original Message ----- From: "Anton Ivanov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 18, 2004 10:16 PM Subject: EXISTS/NOT EXISTS Hi, I'm trying to figure out how to apply these from the manual, but to no avail. Is it possible that my version (4.0.18) does not implement these? I have two tables: products and products_by_product_area. Both have a field "product". I try SELECT product from products WHERE NOT EXISTS (SELECT DISTINCT * from products_by_product_areas WHERE products_by_product_areas.product = products.product); Both of these queries run fine on their own. It looks to me that I'm simply adapting from the manual, but all I get is ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTS (SELECT DISTINCT * from products_by_product_areas WHERE OK, so I grab the example verbatim from the manual: SELECT DISTINCT store_type FROM Stores WHERE EXISTS (SELECT * FROM Cities_Stores WHERE Cities_Stores.store_type = Stores.store_type); And run it. Same error. Never mind that I don't have these tables: the query does not compile. What is going on? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]