SQLite IS NULL operator

The SQLite IS NULL operator is used to check if a value is NULL. NULL stands for nothing, empty, unspecified or similar. It is a special SQLite value essentially representing a missing or unspecified value.

When filtering data in SQLite the NULL value must be treated as a special value. For example, you cannot filter data with the SQLite WHERE clause and the = operator when searching NULL values. This is because NULL does not equal itself. NULL = NULL will return 0 in SQLite.

Instead, when filtering for missing or empty values, use the SQLite IS NULL operator.

Coding example:

SELECT

                name

FROM

                customers

WHERE

                location IS NULL;

This will return the names of all customers with a missing or unspecified location in the customers table.