Hello,

No sooner I sent this message I found out that my version of Mysql 4.0.13 for Solaris 8 does not support Subqueries. In addition, I also found that the MINUS concept in my query is a unique operator to my DB engine. Thanks for your support ands sorry to waste your time.

 

Thanks,

Jaime

 

-----Original Message-----
From:
Sent: Wednesday, May 28, 2003 2:58 PM
To: [EMAIL PROTECTED]
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

 

Reply via email to