NOT IN condition in SQL
General syntax:
where col not in (items)
Items can be
a list of items --
(4,5,3,5,2)
or('243','3','cdds')
or any other datatype.Or a select statement
(select hatefulthings from table)
Addition 6 years later
All major platforms support tuples with NOT IN, for example
SELECT *FROM empoyeeWHERE (empID, @date) NOT IN (SELECT empID, vacationDay FROM empVacation )
In this example we select everything from the employee table where the tuple of employee id and date are not in a table containing vacation days.