The IN condition allows us to check if there is a match in terms of value.

Structure

IN (value)

OR

IN (subquery)

Example

Let’s select users with an ID 5, 7, 9, 11.

SELECT first_name, last_name, username
FROM users
WHERE id IN (5,7,9,11);

Let’s select users with different positions

SELECT u.first_name, u.last_name, p.position
FROM users u
JOIN positions p on p.id = u.position_id
WHERE p.name IN ("software engineer", "senior software engineer", "engineering manager");