124
SQL Server IN ( ) Operators
The SQL Server IN condition is used to avoid multiple OR conditions in a SELECT, INSERT, UPDATE, or DELETE statement.
Syntax
Parameter explanation
expression: It specifies a value to test.
value1, value2,.. value_n: It specifies the values to test against expression.
Note: The SQL Server IN condition is also called the SQL Server IN operator.
IN Condition with string values
An SQL Server SELECT statement that uses the IN condition to compare string values:
Output:
Or
Output:
IN Condition with numeric values
An SQL Server SELECT statement that uses the IN condition to compare numeric values:
Output:
Or
Output:
IN Condition using NOT Operators
An SQL Server SELECT statement that uses the IN condition with NOT operator:
Output:
Or
Output:
Next TopicNOT Operator