DISPLAYS_AS

All functions > COMPARISON > DISPLAYS_AS

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

Signatures

Returns: TRUE if values are not distinct, FALSE otherwise

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

Notes

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

Aliases

  • IS_NOT_DISTINCT_FROM

See also

Examples

Basic comparisons

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

NULL handling

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

Other types

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

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