IN checks a column against a list
When one column could be any of several values, IN says it in one go instead of stringing ORs together. Put the values inside parentheses, separated by commas. A row comes back if its value matches any one value in that list.
A tiny example
In plain English: Show me the names of the students who are in grade 10, 11, or 12.
SELECT name
FROM students
WHERE grade IN (10, 11, 12);What comes back
| name |
|---|
| Mia |
| Leo |
| Ada |
Mia, Leo, and Ada are each in grade 10, 11, or 12 — one of the values in the list.
Related SQL lessons
Ready for a break?
Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.
play today's sip