IS DISTINCT FROM

All functions > COMPARISON > IS DISTINCT FROM

Returns TRUE if two values are distinct, treating NULL values as comparable (SQL-standard spelling).

Syntax

expr1 IS DISTINCT FROM expr2  ·  expr1 NOT DISPLAYS AS expr2

Notes

  • Semantics match NOT DISPLAYS AS; this entry exists so FORMAT preserves IS DISTINCT FROM when you wrote it that way
  • Unlike !=, NULL is treated as comparable here
  • NULL IS DISTINCT FROM NULL is FALSE
  • Operand types must match structurally (including ARRAY/ROW shape and field/element types)

Related Functions

See also

Examples

IS DISTINCT FROM

FeatureQL
SELECT
    -- Same values
    f1 := (1 IS DISTINCT FROM 1),
    -- Different values
    f2 := (1 IS DISTINCT FROM 2),
    -- Both NULL
    f3 := (NULL::BIGINT IS DISTINCT FROM NULL::BIGINT),
    -- NULL vs non-NULL
    f4 := (NULL::BIGINT IS DISTINCT FROM 1),
    -- Non-NULL vs NULL
    f5 := (1 IS DISTINCT FROM NULL::BIGINT)
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEANf4 BOOLEANf5 BOOLEAN
falsetruefalsetruetrue

IS DISTINCT FROM — other types

FeatureQL
SELECT
    -- Same doubles
    f1 := (1e0 IS DISTINCT FROM 1e0),
    -- Both NULL doubles
    f2 := (NULL::DOUBLE IS DISTINCT FROM NULL::DOUBLE)
;
Result
f1 BOOLEANf2 BOOLEAN
falsefalse

IS DISTINCT FROM — arrays and rows

FeatureQL
SELECT
    -- Distinct arrays
    f1 := (ARRAY(1, 2) IS DISTINCT FROM ARRAY(1, 3))
;
Result
f1 BOOLEAN
true

Last update at: 2026/06/20 10:08:10