bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL IN Keyword

Concept visual

SQL IN Keyword

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

IN Keyword

Previous

❮ SQL Keywords

Next

IN

The IN

operator is used in the WHERE clause to check if a specified column's value matches any value within a provided list.

The IN

operator functions as a shorthand for multiple OR conditions, making queries shorter and more readable.

The following SQL uses the IN

operator to select all customers from Germany, France, or UK:

Example

SELECT * FROM Customers
WHERE Country IN ('Germany', 'France', 'UK');
The following SQL selects all customers that are NOT located in "Germany", "France" or "UK":

Example

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

The following SQL selects all customers that are from the same countries as the suppliers:

Example

SELECT * FROM Customers
WHERE Country IN (SELECT Country FROM Suppliers);

Previous

❮ SQL Keywords

Next

Previous

SQL HAVING Keyword

Next

SQL INDEX Keyword