NULL logic handledNULL is handled with IS NULL because NULL inside an IN list never matches.
PASTE INTO A QUERY EDITORSQL CONDITION
surname IN ('O''Brien', 'Smith', 'Jones', 'O''Neill')
OR surname IS NULL
Why NULL is separate
SQL uses three-valued logic. A NULL inside NOT IN can make the whole predicate unknown and silently exclude every row. This output uses AND column IS NOT NULL for exclusions.
This produces an ad hoc SQL literal. For application queries, bind parameters instead of assembling SQL from values.
◎
Runs in this browser. Values stay in this browser. This creates a literal for an ad hoc query; use parameterized queries for application code and user supplied values.
Turn a pasted value column into an ad hoc SQL IN or NOT IN condition, with apostrophe escaping and NULL logic handled. Results update as you adjust inputs and stay in this browser.