Was this helpful?
IN Predicate
The following table explains the operators IN and NOT IN:
Operator
Meaning
e IN (x, ..., z)
The IN predicate returns true if e is equal to one of the values in the list (x, ..., z).
(x, ..., z) represents a list of expressions, each of which must evaluate to a single, constant value. If there is only one expression in the list, the parentheses are optional.
(e,…) IN ((x,…),…,(z,…))
The IN predicate for row valued expressions. Similarly to the simpler IN form, ((x,…),…,(z,…) represents a list of row value expressions that must each evaluate to constant values.
Note:  Not currently implemented.
y NOT IN (x, ..., z)
Returns true if y is not equal to any of the values in the list (x, ..., z).
(x, ..., z) is a list of expressions, each of which must evaluate to a single, constant value. If there is only one expression in the list, the parentheses are optional. None of the expressions (y, x, or z) can be subqueries.
(e,…) NOT IN ((x,…),…,(z,…))
The NOT IN predicate for row valued expressions. Similarly to the simpler NOT IN form, ((x,...,(z,…) represents a list of row value expressions that must each evaluate to constant values.
Note:  Not currently implemented.
y IN (subquery)
Returns true if y is equal to one of the values returned by the subquery. The subquery must be parenthesized and can reference only one column in its SELECT clause.
If y is a row valued expression, its elements must correspond directly to the number of subquery result columns.
y NOT IN (subquery)
Returns true if y is not equal to any of the values returned by the subquery. The subquery must be specified in parentheses and can reference only one column in its SELECT clause.
If y is a row valued expression, its elements must correspond directly to the number of subquery result columns.
Last modified date: 08/14/2024