IS [NOT] DISTINCT FROM
Compares two expressions to determine whether they have the same or different values. IS DISTINCT FROM returns TRUE if the values are different, and IS NOT DISTINCT FROM returns TRUE if they are the same. Unlike <> and =, they treat two NULL values as the same and never return NULL.
Syntax
IS [NOT] DISTINCT FROM(expression1 any, expression2 any) → boolean
- expression1: First expression. Can be a general expression of any Dremio-supported data type.
- expression2: Second expression. Can be a general expression of any Dremio-supported data type.
Examples
IS [NOT] DISTINCT FROM exampleSELECT NULL IS DISTINCT
FROM NULL
-- False
SELECT 1 IS DISTINCT FROM 2
-- true
SELECT 1 IS DISTINCT FROM 1
-- false
SELECT 1 IS DISTINCT FROM NULL
-- true
SELECT 'Dremio' IS DISTINCT FROM 'Cloud'
-- true
SELECT NULL IS NOT DISTINCT
FROM NULL
-- True
SELECT 1 IS NOT DISTINCT FROM 1
-- true
SELECT 1 IS NOT DISTINCT FROM 2
-- false
SELECT 1 IS NOT DISTINCT FROM NULL
-- false