Having problem with simple "NOT IN" query



Hello all,

I have two tables

tab_a id(int)
tab_b id(int)

and I try the following select which returns an error:

SELECT id from tab_a
where id NOT IN
(select id from tab_b);

#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 id from tab_b) LIMIT 0, 30' at line 3


Please advise.

Cheers,

Manny

.



Relevant Pages

  • Re: Volltextsuche: ERROR 1064 (42000): You have an error
    ... You have an error in your SQL syntax; ... manual that corresponds to your MySQL server version for the right ... So steht's doch auch in der Doku. ... Von NATURAL LANGUAGE MODE steht da nix. ...
    (de.comp.datenbanken.mysql)
  • Re: Periods in Column name
    ... > I seem to have an issue with select-ing a column by name if it has more ... You have an error in your SQL syntax. ... > that corresponds to your MySQL server version for the right syntax to ... use them when quoting column names unless you start the server in ANSI mode in ...
    (perl.dbi.users)
  • Re: Restoring mysql 3.23.54a-0.woody backups to 4.0.24-10 (sarge)
    ... You have an error in your SQL syntax. ... the manual that corresponds to your MySQL server version for the ... DROP TABLE IF EXISTS mails; ...
    (Debian-User)
  • Re: Not finding results
    ... MySQL error 1064: You have an error in your SQL syntax. ... manual that corresponds to your MySQL server version for the right ... PHP code is run, and all it's variables evaluated, on the server-side before ...
    (alt.php)
  • Periods in Column name
    ... macs WHERE ipaddress = ?"); ... DBD::mysql::st execute failed: You have an error in your SQL syntax. ... Check the manual that corresponds to your MySQL server version for the ...
    (perl.dbi.users)