Based on this page:
http://dev.mysql.com/doc/mysql/en/ANY_IN_SOME_subqueries.html
and this statement:
SELECT s1 FROM t1 WHERE s1 IN (SELECT s1 FROM t2);
I expected the following 2 statements to work from the mysql CL:
mysql> select id from users where id in (select uid from group_users);
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 uid from group_users)' at line 1
#or more simply
mysql> select 7 in (select 7);
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 7)' at line 1
#interestingly this does work
mysql> select 7 in (6, 7);
+-------------+
| 7 in (6, 7) |
+-------------+
| 1 |
+-------------+
1 row in set (0.00 sec)
My install details
mysql Ver 12.22 Distrib 4.0.18, for sun-solaris2.8 (sparc)
Is this suppoed to work? Any advice would be appreciated.