Beginner

363. IN Operator

Learn how to match a value against multiple possible values.

📘 Lesson 363 of 728 ⏱ 9 min 🎯 Beginner

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.

SQL
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.

Have you finished this lesson?

Introduction to SQL – All Lessons