Skip to main content

IS [ NOT ] DISTINCT FROM

Compares whether two expressions are equal (or not equal) with awareness of nullability, meaning it treats NULLs as known values for comparing equality.

Syntax

<expr1> IS [ NOT ] DISTINCT FROM <expr2>

Examples

SELECT NULL IS DISTINCT FROM NULL;

┌────────────────────────────┐
null is distinct from null
├────────────────────────────┤
false
└────────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today