The NOT IN predicate acts opposite to the "IN" predicate. It can be used to specify multiple values that should NOT be present in a WHERE clause. Note that NOT IN
NOT Logical Operator
If you want to find rows that do not satisfy a condition, you can use the logical operator NOT
. NOT
results in the reverse of a condition. That is, if a condition is satisfied, then the row is not returned.
NOT IN
can be represented as conjunction of NOT equal comparison operators.
A NOT IN (B, C)
<=> (NOT A=B) AND (NOT A=C)
If one of A or B is NULL, then NOT IN is not True (Undefined)
IN Predicate
The IN
predicate is used when you want to compare a column with more than one value. It is similar to a number of equals comparisons OR
-ed together.