SQL Language Guide : 4. Elements of SQL Statements : Predicates in SQL : IN Predicate
 
Share this page                  
IN Predicate
The following table explains the operators IN and NOT IN:
Operator
Meaning
y IN (x, ..., z)
The IN predicate returns true if y 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 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.
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 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.
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.
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.