What is SQL IN?
The SQL IN operator enables a comparison to a list of values or to the results of a SUBSELECT.
Why Use SQL IN?
The SQL IN operator is a clean way to check for inclusion in lists without creating a series of OR clauses.
How To Use SQL IN
SQL IN is used as follows.
SQL IN Syntax
There must be one or more members of the value_list. Numeric and non-numeric values are supported.
SQL IN Example
The following example selects information from the BRANCH where the region_nbr is IN a specified list of region_nbr values.
Here are the contents of the table:
This SQL Statement with IN is executed:
Here is the result.