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-safe equality) NULL DISPLAYS AS NULLis TRUE (they are the same)value DISPLAYS AS NULLis FALSE when value is not NULL- Nested NULL inside ARRAY/ROW is compared null-safely at every nesting level
- 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
-- `DISPLAYS_AS(expr1, expr2)` matches keyword `DISPLAYS AS`
f1 := DISPLAYS_AS(1, 1),
-- Both NULL: null-safe equality
f2 := DISPLAYS_AS(NULL::BIGINT, NULL::BIGINT),
-- Nested NULL fields match
f3 := DISPLAYS_AS(
ROW(1::BIGINT, NULL::BIGINT),
ROW(1::BIGINT, NULL::BIGINT)
)
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| true | true | true |
DISPLAYS_AS — chained
FeatureQL
SELECT
-- Receiver is the left-hand operand
f1 := (1).DISPLAYS_AS(1),
-- Same semantics as the prefix call
f2 := (NULL::BIGINT).DISPLAYS_AS(NULL::BIGINT)
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |