[prog] MySQL & 'IN'

Terri Oda terri at zone12.com
Sat Jul 17 16:39:42 EST 2004


On Jul 17, 2004, at 2:05 PM, Karine Proot wrote:
> This may be the root of the problem. I know which version I'm using
> (4.0.15a), but can't find out when sub-select statements were added to
> MySQL.
> I do look at the docs online, so I guess this is the first thing to 
> look
> for. Do you have any clue about how to find out which MySQL accepts 
> what
> ?

I tried to look this up earlier and didn't find it on mysql's site 
(mind you, I didn't look for very long, so it's probably there) but the 
posts I saw on other boards suggested that this was new in 4.1 alpha.

So... let's see what the new features available are.... Yup, there it 
is:

http://dev.mysql.com/doc/mysql/en/Nutshell_4.1_features.html

"Support for subqueries and derived tables

         * A ``subquery'' is a SELECT statement nested within another 
statement. A ``derived table'' (an unnamed view) is a subquery in the 
FROM clause of another statement. See section 14.1.8 Subquery Syntax. "

So you'd have to try 4.1 (now at 4.1.3 beta) or another database 
(postgres can do it, I believe) if you want to use subqueries.  Or do 
multiple queries in mysql to do the same thing (views are the preferred 
way, if I recall correctly).

  Terri



More information about the Programming mailing list