The NOT IN operator acts opposite to "IN" Operator. 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 operator is not True (Undefined)
IN Comparison Operator
The IN
operator is used when you want to compare a column with more than one value. It is similar to an OR
condition.