EQUALS()
All functions > COMPARISON > EQUALS()
Returns TRUE if the first value equals the second value
Signatures
Returns: TRUE or FALSE according to the comparison, or NULL if either operand is NULL
EQUALS(expr1: T, expr2: T, [digits: BIGINT]) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
expr1 | T | Yes | First value to compare |
expr2 | T | Yes | Second value to compare |
digits | BIGINT | No | Optional decimal precision for numeric comparisons |
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
- For numeric types, supports optional decimal precision
- For dates/timestamps, compares exact date and time values
- For ARRAY and ROW, compares element- or field-by-element when types align
Related operators
Examples
EQUALS — functional call
FeatureQL
SELECT
f1 := EQUALS(42, 42), -- `EQUALS(expr1, expr2)` matches infix `=`
f2 := EQUALS(1, 2) -- Unequal scalars
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
EQUALS — chained
FeatureQL
SELECT
f1 := (42).EQUALS(42), -- Dot form: receiver is the left-hand operand
f2 := (1).EQUALS(2) -- Same semantics as the prefix call
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |