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
| Parameter | Type | Required | Description |
|---|---|---|---|
expr1 | T | Yes | First value to compare |
expr2 | T | Yes | Second value to compare |
Notes
- Unlike regular inequality (
!=), this function treats NULL values as comparable NULL NOT_DISPLAYS_AS NULLReturns FALSE (they are not distinct)value NOT_DISPLAYS_AS NULLReturns TRUE if value is not NULLNULL NOT_DISPLAYS_AS valueReturns 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 BOOLEAN | f2 BOOLEAN |
|---|---|
| FALSE | TRUE |
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 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| FALSE | TRUE | TRUE |
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 BOOLEAN | f2 BOOLEAN |
|---|---|
| FALSE | FALSE |