MySQL only supports sub-queries as of v4.1.  What version are you running now?

While I am not terribly familiar with joins, I believe that one, properly
executed, could solve your problem.  In fact, a similar question was raised
earlier today.  Search the archives for a post with the subject "Update in
select"

Good luck!

Edward Dudlik
Becoming Digital
www.becomingdigital.com


----- Original Message -----
From: "Jaime J. Maiz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, 28 May, 2003 15:58
Subject: How to perform the following Query in MySQL



Hello,
I am studying the possible migration of a system using another database
engine to MySQL for various reasons. However, I have several instances of
the following query spread throughout my application that do not work in
mysql.

The query is:

Select count(*) from customer where customer.id in (select customer.id where
customer.status='A' and customer.id = customer.opt_id MINUS select vendor.id
from vendor)

The error I receive is Error Code 1064, DB Error State = 42000 indicating an
error in my SQL syntax. I checked the documentation and found that for mysql
the SET MEMBERSHIP CLAUSE (IN) can only accept lists made of constants.
However, my SQL reference shows this query as a valid SQL2 type query.

I have two questions:
1.      Can anyone tell me why is this query returning an error in mysql?
2.      Can anyone suggest a way to write this query in a mysql friendly
way?

TIA
Jaime
-----------------------------------------------------------------
Jaime J. Maiz                        630 979 2088
mailto:[EMAIL PROTECTED]      IH 4F-310




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

Reply via email to