Bug #2785 Subqueries not working
Submitted: 13 Feb 2004 19:56 Modified: 13 Feb 2004 22:45
Reporter: Ravi Shanker Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.17 OS:Windows (Win 2K)
Assigned to: CPU Architecture:Any

[13 Feb 2004 19:56] Ravi Shanker
Description:
I'm trying subqueries, but they are not working.  I'm using 4.0.17 version I just downloaded few days ago.  For eg.,
SELECT sname FROM services WHERE sid IN (SELECT sid FROM branches_services WHERE bid = 1031);
It is throwing the following error 
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 'SELECT sid FROM branches_services WHERE bid = 1031)' at line 1.

Does MySql support Subqueries ?

How to repeat:
Try the following query

SELECT sname FROM services WHERE sid IN (SELECT sid FROM branches_services WHERE bid = 1031);

Suggested fix:
Does MySql support subqueries ?
[13 Feb 2004 22:45] Georg Richter
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.

Additional info:

To use subqueries you need MySQL Version 4.1 or higher.