Help me!
in documentation http://dev.mysql.com/doc/mysql/en/any-in-some-subqueries.html :
SELECT s1 FROM t1 WHERE s1 IN (SELECT s1 FROM t2);
i'l create dbs:
------------------------------------
CREATE TABLE `t1` (
`id1` int(11) NOT NULL default '0'
) TYPE=MyISAM;
INSERT INTO `t1` VALUES (111);
INSERT INTO `t1` VALUES (112);
INSERT INTO `t1` VALUES (113);
INSERT INTO `t1` VALUES (114);
INSERT INTO `t1` VALUES (115);
INSERT INTO `t1` VALUES (116);
CREATE TABLE `t2` (
`id2` int(11) NOT NULL default '0'
) TYPE=MyISAM;
INSERT INTO `t2` VALUES (111);
INSERT INTO `t2` VALUES (113);
INSERT INTO `t2` VALUES (115);
------------------------------------
the i try to use IN:
mysql> SELECT id1 FROM t1 WHERE id1 NOT IN ( SELECT id2 FROM t2 );
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 id2 FROM t2 )' at line 1
What's wrong???