Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
SQL

IN and NOT IN in SQL

Match values against a list with IN / NOT IN.

IN and NOT IN in SQL — a practical guide to SQL IN NOT IN with clear examples you can reuse in real projects.

SQL Tutorial Series (30/100). Prefer one article? Read the complete SQL tutorial.

Short description

Prefer JOIN/EXISTS over long NOT IN lists with NULLs — NULL handling can surprise you.

IN

SELECT * FROM products
WHERE category_id IN (1, 2, 5);

Leave a reply

Your email address will not be published. Required fields are marked *