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 spelling).

Signatures

Returns: Null-safe equality / inequality result

IS_NOT_DISTINCT_FROM(expr1: T, expr2: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1TYesFirst value
expr2TYesSecond value

Notes

  • Same semantics as DISPLAYS AS; use this registry entry when the source uses IS NOT DISTINCT FROM so FORMAT does not rewrite it
  • Unlike =, NULL is treated as comparable here
  • NULL IS NOT DISTINCT FROM NULL is TRUE
  • Operand types must match structurally (including ARRAY/ROW)

Related operators

See also

Examples

IS_NOT_DISTINCT_FROM — functional call

FeatureQL
SELECT
    f1 := IS_NOT_DISTINCT_FROM(1, 1), -- `IS_NOT_DISTINCT_FROM(expr1, expr2)` matches SQL spelling
    f2 := IS_NOT_DISTINCT_FROM(NULL::BIGINT, NULL::BIGINT) -- Both NULL: null-safe equality
;
Result
f1 BOOLEANf2 BOOLEAN
truetrue

IS_NOT_DISTINCT_FROM — chained

FeatureQL
SELECT
    f1 := (1).IS_NOT_DISTINCT_FROM(1), -- Receiver is the left-hand operand
    f2 := (NULL::BIGINT).IS_NOT_DISTINCT_FROM(NULL::BIGINT) -- Same semantics as the prefix call
;
Result
f1 BOOLEANf2 BOOLEAN
truetrue

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