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
| Parameter | Type | Required | Description |
|---|---|---|---|
expr1 | T | Yes | First value |
expr2 | T | Yes | Second value |
Notes
- Same semantics as DISPLAYS AS; use this registry entry when the source uses
IS NOT DISTINCT FROMso FORMAT does not rewrite it - Unlike
=, NULL is treated as comparable here NULL IS NOT DISTINCT FROM NULLis 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 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |
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 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |