Checking for Missing Values

tags: #sql

It is not possible to test for NULL values with comparison operators, such as =, <, or <>.

We will have to use the IS NULL and IS NOT NULL operators instead with the WHERE Clause.

IS NULL Syntax

The IS NULL operator is used to test for empty values (NULL values).

SELECT column_name
FROM table_name
WHERE column_name IS NULL;
IS NOT NULL Syntax

The IS NOT NULL operator is used to test for non-empty values (NOT NULL values).

SELECT column_name
FROM table_name
WHERE column_name IS NOT NULL;
Powered by Forestry.md