The IN operator checks whether a value matches any value in a specified list.
IN makes multiple equality conditions shorter, clearer, and easier to maintain.
Find employees from IT, Finance, or HR.
SELECT
EmployeeName,
Department
FROM Employees
WHERE Department IN ('IT', 'Finance', 'HR');
IN is commonly used for filtering departments, regions, statuses, product categories, and other predefined groups.
- IN checks multiple possible values.
- It can replace repeated OR conditions.
- It improves query readability.
- It can be used with numbers, text, and dates.
- NOT IN excludes listed values.
What does IN do?
IN checks whether a value matches any value in a specified list.
Why use IN instead of multiple OR conditions?
IN usually makes repeated equality conditions shorter and easier to read.