Beginner

178. IN Operator

Learn how IN checks whether a value matches any value in a specified list.

📘 Lesson 178 of 728 ⏱ 8 min 🎯 Beginner

The IN operator checks whether an expression matches one of the values provided in a list or returned by a subquery.

IN makes multiple equality conditions easier to write and read.

Find employees working in IT, Finance, or HR.

SQL
SELECT
    EmployeeName,
    Department
FROM Employees
WHERE Department IN ('IT', 'Finance', 'HR');

IN is commonly used for department filters, customer categories, product groups, status values, and business selections.

  • IN checks membership in a list.
  • It can replace multiple OR conditions.
  • It can be used with text and numeric values.
  • IN can work with subqueries.
  • NOT IN excludes listed values.
What does IN do in SQL?

IN checks whether a value matches any value in a specified list or subquery result.

Why use IN instead of multiple OR conditions?

IN usually makes multiple equality conditions shorter and easier to read.

Have you finished this lesson?

Introduction to SQL – All Lessons