Check for NULL

Syntax

…nullable-expr… IS NULL

…nullable-expr… IS NOT NULL

Typing

t? -> BOOL

Description

Test any nullable operand for NULL. Always returns a non-nullable boolean.

Notice that this is not equivalent to comparing a value to NULL using the equality operator. Indeed, NULL propagates through the equality operator and the result of such a comparison would merely be NULL.

Examples

expression evaluates to
NULL IS NULL TRUE
NULL IS NOT NULL FALSE
(NULL = 1) IS NULL TRUE

See Also

Selects the first non null operand Convert to not-null or crash