A null condition is used to detect NULL values.
Syntax
expr IS [ NOT ] NULL
Usage instructions
IS NULLchecks whether an expression is NULL. If the expression is NULL, it returns TRUE; otherwise, it returns FALSE.IS NOT NULLchecks whether an expression is not NULL. If the expression is not NULL, it returns TRUE; otherwise, it returns FALSE.
Examples
obclient> CREATE TABLE emp (
empno INT,
last_name VARCHAR(20),
comm_pct DECIMAL(5, 2)
);
obclient> INSERT INTO emp VALUES
(1, 'Smith', NULL),
(2, 'Jones', 0.10);
obclient> SELECT last_name FROM emp WHERE comm_pct IS NULL ORDER BY last_name;
