= [equals]
All functions > COMPARISON > = [equals]
Returns TRUE if the first value equals the second value
Syntax
expr1 = expr2
Notes
- Both values must be of the same or compatible types
- NULL comparisons always return NULL (three-valued logic)
- For strings, performs case-sensitive exact match
- On FLOAT/DOUBLE, write
.N(e.g.>.2,=.4,BETWEEN.3) for N digits of rounded precision viaDECIMAL(38, N)staging - Any NaN operand makes the comparison NULL
- Infinity, or any finite value too large for
DECIMAL(38, N), falls back to a raw float compare —.Nrounding is not applied on that path - For dates/timestamps, compares exact date and time values
- For ARRAY and ROW, compares element- or field-by-element when types align
- Nested NULL in either ARRAY/ROW operand makes
=NULL (structural mismatch does not rescue a poisoned pair) - For null-safe equality, use DISPLAYS AS
Related Functions
Examples
= — values and strings
FeatureQL
SELECT
-- Numeric equality
f1 := 42 = 42,
-- Exact string match
f2 := 'hello' = 'hello',
-- Case sensitive
f3 := 'Hello' = 'hello'
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| true | true | false |
= — arrays and rows
FeatureQL
SELECT
-- Element-wise; integer/decimal may align per element
f1 := ARRAY(1, 2, 3) = ARRAY(1., 2., 3.),
-- Field-wise; same rules as scalars on each field
f2 := ROW(1 AS a) = ROW(1. AS a)
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |
= — three-valued logic
FeatureQL
SELECT
-- `=` never yields TRUE for NULL = NULL
f1 := NULL::BIGINT = NULL::BIGINT,
-- Non-NULL vs NULL
f2 := 1 = NULL::BIGINT,
-- Nested NULL poisons `=` (use DISPLAYS AS for null-safe)
f3 := ROW(1::BIGINT, NULL::BIGINT) = ROW(1::BIGINT, NULL::BIGINT),
-- Mismatch does not rescue a poisoned pair
f4 := ROW(1::BIGINT, NULL::BIGINT) = ROW(2::BIGINT, 2::BIGINT)
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN | f4 BOOLEAN |
|---|---|---|---|
| NULL | NULL | NULL | NULL |