IS_DISTINCT_FROM()

All functions > COMPARISON > IS_DISTINCT_FROM()

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

Signatures

Returns: Null-safe equality / inequality result

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

Notes

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

Related operators

See also

Examples

IS_DISTINCT_FROM — functional call

FeatureQL
SELECT
    -- `IS_DISTINCT_FROM(expr1, expr2)` matches SQL spelling
    f1 := IS_DISTINCT_FROM(1, 2),
    -- Same value is not distinct
    f2 := IS_DISTINCT_FROM(1, 1)
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

IS_DISTINCT_FROM — chained

FeatureQL
SELECT
    -- Receiver is the left-hand operand
    f1 := (1).IS_DISTINCT_FROM(2),
    -- Same semantics as the prefix call
    f2 := (1).IS_DISTINCT_FROM(1)
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse