baisc syntax question - not in (1,2,3)

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

baisc syntax question - not in (1,2,3)

Post by pedrotuga »

What's the syntax for geting al the rows which col_a not in a list of values?


should be something like

Code: Select all

select * from table where id not in (2, 5, 1, 7);
or

Code: Select all

select * from table where id ~in (2, 5, 1, 7);
or

Code: Select all

select * from table where id !in (2, 5, 1, 7);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Have you tried them?
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

:oops: :oops: :oops: :oops: :oops:

mods, please delete this thread
Post Reply