SQL IN
The IN operator is used in a WHERE clause to filter records that match any value in a specified list. It is a shorthand for multiple OR conditions.
Syntax
column_name IN (value1, value2, value3, ...) Equivalent to: column_name = value1 OR column_name = value2 OR column_name = value3
Numeric Example: Find orders for customers 101 and 103
SELECT OrderID, CustomerID, ProductName FROM Orders WHERE CustomerID IN (101, 103);
Text Example: Find orders for specific products
SELECT OrderID, ProductName
FROM Orders
WHERE ProductName IN ('Laptop', 'Monitor');
Date Example: Find orders on specific dates
SELECT OrderID, OrderDate
FROM Orders
WHERE OrderDate IN ('2026-03-10', '2026-03-11');
Summary Definition for Exam/Interviews:
IN in SQL Server is used to filter records matching any value in a given list or subquery. It simplifies multiple OR conditions and can be used with numbers, text, or dates.