Multiple Values with IN
IN checks if a value matches any in a list.
This is cleaner than:
WHERE department_id = 1
OR department_id = 2
OR department_id = 3Works with text too:
WHERE first_name IN ('John', 'Sarah', 'Mike')NOT IN finds values NOT in the list.
Check your understanding
Find employees in departments 1 or 3.
Examples run on the employees sample database. Open any of them in the playground to experiment.