NOT_DISPLAYS_AS

All functions > COMPARISON > NOT_DISPLAYS_AS

Returns TRUE if two values are distinct, treating NULL values as comparable.

Signatures

Returns: TRUE if values are distinct, FALSE otherwise

NOT_DISPLAYS_AS(expr1: T, expr2: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
expr1TYesFirst value to compare
expr2TYesSecond value to compare

Notes

  • Unlike regular inequality (!=), this function treats NULL values as comparable
  • NULL NOT_DISPLAYS_AS NULL Returns FALSE (they are not distinct)
  • value NOT_DISPLAYS_AS NULL Returns TRUE if value is not NULL
  • NULL NOT_DISPLAYS_AS value Returns TRUE if value is not NULL
  • Both values must be of the same type
  • Standard SQL alias: IS_DISTINCT_FROM
  • Can be used with operator syntax: value1 IS DISTINCT FROM value2

Aliases

  • IS_DISTINCT_FROM

See also

Examples

Basic comparisons

FeatureQL
SELECT
    f1 := 1 NOT DISPLAYS AS 1,  -- Same values
    f2 := 1 NOT DISPLAYS AS 2  -- Different values
;
Result
f1 BOOLEANf2 BOOLEAN
FALSETRUE

NULL handling

FeatureQL
SELECT
    f1 := NULL::BIGINT NOT DISPLAYS AS NULL::BIGINT,  -- Both NULL
    f2 := NULL::BIGINT NOT DISPLAYS AS 1,  -- NULL vs non-NULL
    f3 := 1 NOT DISPLAYS AS NULL::BIGINT  -- Non-NULL vs NULL
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEAN
FALSETRUETRUE

Other types

FeatureQL
SELECT
    f1 := 1e0 NOT DISPLAYS AS 1e0,  -- Same doubles
    f2 := NULL::DOUBLE NOT DISPLAYS AS NULL::DOUBLE  -- Both NULL doubles
;
Result
f1 BOOLEANf2 BOOLEAN
FALSEFALSE

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19