IN search condition

Syntax
expression [ NOT ] IN { ( subquery ) | ( expression2 ) | ( value-expression1, ... ) }
Remarks

An IN search condition, without the NOT keyword, evaluates according to the following rules:

  • TRUE if expression is not NULL and equals at least one of the values.
  • UNKNOWN if expression is NULL and the values list is not empty, or if at least one of the values is NULL and expression does not equal any of the other values.
  • FALSE if expression is NULL and subquery returns no values; or if expression is not NULL, none of the values are NULL, and expression does not equal any of the values.

The NOT keyword interchanges TRUE and FALSE.

The search condition expression IN ( values ) is equivalent to expression = ANY ( values ).

The search condition expression NOT IN ( values ) is equivalent to expression <> ALL ( values ).

The value-expression arguments are expressions that take on a single value, which may be a string, a number, a date, or any other SQL data type.