DISPLAYS_AS()
All functions > COMPARISON > DISPLAYS_AS()
Returns TRUE if two values are not distinct, treating NULL values as comparable.
Signatures
Returns: Null-safe equality / inequality result
DISPLAYS_AS(expr1: T, expr2: T) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
expr1 | T | Yes | First value |
expr2 | T | Yes | Second value |
Notes
- Unlike
=, NULL is treated as comparable here NULL DISPLAYS AS NULLis TRUE (they are the same)value DISPLAYS AS NULLis FALSE when value is not NULLNULL DISPLAYS AS valueis FALSE when value is not NULL- Both values must be of the same type (including ARRAY/ROW)
- Opposite of NOT DISPLAYS AS
- FeatureQL-native spelling; SQL
IS NOT DISTINCT FROMis registered separately so format/querytools match the syntax you used
Related operators
See also
Examples
DISPLAYS_AS — functional call
FeatureQL
SELECT
f1 := DISPLAYS_AS(1, 1), -- `DISPLAYS_AS(expr1, expr2)` matches keyword `DISPLAYS AS`
f2 := DISPLAYS_AS(NULL::BIGINT, NULL::BIGINT) -- Both NULL: null-safe equality
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |
DISPLAYS_AS — chained
FeatureQL
SELECT
f1 := (1).DISPLAYS_AS(1), -- Receiver is the left-hand operand
f2 := (NULL::BIGINT).DISPLAYS_AS(NULL::BIGINT) -- Same semantics as the prefix call
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |