IS NOT DISTINCT FROM

All functions > COMPARISON > IS NOT DISTINCT FROM

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

Syntax

expr1 IS NOT DISTINCT FROM expr2  ·  expr1 DISPLAYS AS expr2

Notes

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

Related Functions

See also

Examples

IS NOT DISTINCT FROM

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

IS NOT DISTINCT FROM — other types

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

IS NOT DISTINCT FROM — arrays and rows

FeatureQL
SELECT
    f1 := (ARRAY(1, 2) IS NOT DISTINCT FROM ARRAY(1, 2)), -- Equal arrays
    f2 := (NULL::ARRAY(BIGINT) IS NOT DISTINCT FROM NULL::ARRAY(BIGINT)) -- Both NULL arrays
;
Result
f1 BOOLEANf2 BOOLEAN
truetrue

Last update at: 2026/05/26 17:22:09