Javatpoint Logo
Javatpoint Logo

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:

SQL Server in 1

Or

Output:

SQL Server in 2

IN Condition with numeric values

An SQL Server SELECT statement that uses the IN condition to compare numeric values:

Output:

SQL Server in 3

Or

Output:

SQL Server in 4

IN Condition using NOT Operators

An SQL Server SELECT statement that uses the IN condition with NOT operator:

Output:

SQL Server in 5

Or

Output:

SQL Server in 6
Next TopicNOT Operator




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA