Last updated

SQL IN

Definition: IN checks whether a value matches any value in a list. It is a clean shorthand for several OR conditions.

Example 1 — match a list of countries

SELECT * FROM Customers
WHERE Country IN ('Germany', 'France', 'UK');

This is equivalent to Country = 'Germany' OR Country = 'France' OR Country = 'UK' — just shorter and easier to read.

Example 2 — NOT IN

Find everyone who is not in those countries:

SELECT * FROM Customers
WHERE Country NOT IN ('Mexico', 'Canada');

Example 3 — IN with numbers

SELECT * FROM Products
WHERE ProductID IN (1, 5, 9);

💡 Tip: IN keeps long "this OR that OR the other" filters short and tidy.

Try it Yourself
Output

          
Ad · responsive