NOT DISPLAYS AS
All functions > COMPARISON > NOT DISPLAYS AS
Returns TRUE if two values are distinct, treating NULL values as comparable.
Syntax
expr1 NOT DISPLAYS AS expr2 · expr1 IS DISTINCT FROM expr2
Notes
- Unlike
!=, NULL is treated as comparable here (three-valued logic does not apply the same way) NULL NOT DISPLAYS AS NULLis FALSE (they are not distinct)value NOT DISPLAYS AS NULLis TRUE when value is not NULLNULL NOT DISPLAYS AS valueis TRUE when value is not NULL- Both values must be of the same type (including the same ARRAY/ROW shape and field/element types)
- SQL spelling
IS DISTINCT FROMis a separate operator/function pair (same semantics, preserves formatting)
Related Functions
See also
Examples
NOT DISPLAYS AS
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 |
NOT DISPLAYS AS — arrays and rows
FeatureQL
SELECT
f1 := ARRAY(1, 2) NOT DISPLAYS AS ARRAY(1, 3), -- Distinct arrays
f2 := NULL::ARRAY(BIGINT) NOT DISPLAYS AS NULL::ARRAY(BIGINT) -- Both NULL arrays
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |