T-SQL Tutorial

SQL In


In Syntax:

SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,value3,...)

Employee table:

EMPLOYEE_IDNAMEDEP_ID
1John33
2Samantha34
3Bill35
4James36
5Sandra37

In Example:

SELECT * FROM employee
WHERE name IN ('Samantha', 'Bill', 'Sandra');

In Result:

2Samantha34
3Bill35
5Sandra37