Checked against official sources on November 13, 2026
You have a table of tickets. Some rows have no status yet. You want those rows. You write WHERE status = NULL. The query comes back empty.
Nothing is broken. SQL did what it was told. NULL is not a value you can compare with =.
Everything below was run in SQLite 3.46.1.
The bug in a few lines
CREATE TABLE tickets (id INTEGER, status TEXT); INSERT INTO tickets VALUES (1, 'open'), (2, 'closed'), (3, NULL); SELECT * FROM tickets WHERE status = NULL; It returns no rows. Ticket 3 is right there, with no status, and the query still skips it.
Why equals does not work
In SQL, NULL means "we do not know the value." It is not the text 'NULL'. It is not zero. It is not an empty string.
When you compare with =, SQL answers yes, no, or "I do not know." An = comparison that includes NULL is always "I do not know." Even this one:
SELECT NULL = NULL; The result is NULL, not true. "Is one unknown value the same as another unknown value?" SQL will not say yes.
SELECT 7 = NULL; That is NULL too.
A WHERE clause only keeps a row when the test is yes (true). The SQLite docs say a row is dropped if the test is false or NULL. So WHERE status = NULL keeps nothing.
The fix: IS NULL
To ask "is this cell not set?", use IS NULL. Do not use =.
SELECT * FROM tickets WHERE status IS NULL; It returns one row: ticket 3, whose status is NULL. That is the row we wanted.
IS NOT NULL returns the other two, the ones with a real status: tickets 1 and 2.
SELECT NULL IS NULL; The result is 1. In SQLite, 1 means true. The SQLite docs say IS and IS NOT still work when a side is NULL. They answer true or false, never "I do not know."
If you want to show a stand-in for a missing value, COALESCE picks the first value that is not NULL:
SELECT id, COALESCE(status, 'not set') FROM tickets; It returns:
1 open 2 closed 3 not set Two more places this shows up
COUNT(*) counts every row. COUNT(status) skips rows where status is NULL.
SELECT COUNT(*), COUNT(status) FROM tickets; It returns 3 and 2. The third ticket has no status, so COUNT(status) does not include it. If you treat COUNT(status) as "how many tickets," you are one short.
NOT IN has a sharper trap. Say you want every ticket that is not closed, and the list happens to include a NULL:
SELECT * FROM tickets WHERE status NOT IN ('closed', NULL); It returns no rows. Not even the open ticket. For that row, the test is "I do not know," so WHERE drops it. If you write the list yourself, leave NULL out. If a second query builds the list, a NULL in that result can hide rows the same way.
This form is safe for "not closed":
SELECT * FROM tickets WHERE status IS NOT NULL AND status <> 'closed'; <> means "is not equal to." It returns only ticket 1, the open one.
Quick check you can use
- Looking for cells that are not set? Use
IS NULLorIS NOT NULL. Never use=or<>withNULL. - Counting?
COUNT(*)is every row.COUNT(column)skipsNULLin that column. - A
NOT INlist looks right, but rows are missing? Check the list forNULL. An unknown value in the list can wipe out the result.
Docs we opened
- SQLite docs, SQL Language Expressions (
ISandIS NOT, and theIN/NOT INtable) - SQLite docs, SELECT: WHERE clause filtering
- SQLite docs, Built-in Aggregate Functions (
count(*)andcount(X)) - SQLite docs, coalesce()
- PostgreSQL docs, Comparison Functions and Operators (the same
=rule, as used in standard SQL)
About TalentOp Systems LLC
Our team works out of Omaha, Nebraska, and we have been in business since February 2025. We do IT staffing, software consulting and project development, and we staff software roles for clients in banking, insurance, healthcare and retail. Roles can be W2 or C2C, and many run 12+ months.
TalentOp Systems is a direct vendor for Kroger, whose offices are in Blue Ash, Ohio.
E-Verify: yes, TalentOp Systems LLC is enrolled and E-Verified.
Need H-1B sponsorship? TalentOp Systems LLC provides it for hires who meet the role's requirements and eligibility.
We also take H-1B transfers, and OPT or STEM OPT candidates are welcome to reach out.
Find us at www.talentopsystems.com or email info@talentopsystems.com.

