LESS_THAN_OR_EQUALS()
All functions > COMPARISON > LESS_THAN_OR_EQUALS()
Returns TRUE if the first value is less than or equal to the second value
Signatures
Returns: TRUE or FALSE according to the comparison, or NULL if either operand is NULL
LESS_THAN_OR_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 | Digits of rounded FLOAT/DOUBLE precision (.N); not applied when Inf or magnitude overflows DECIMAL(38, N) staging |
Notes
- Both values must be of comparable types
- NULL comparisons always return NULL (three-valued logic)
- Returns TRUE if values are equal OR first is less than second
- For strings, uses lexicographic (dictionary) ordering
- For dates/timestamps, compares chronologically
- For ARRAY and ROW, ordering is lexicographic / field-by-field when types align
- 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
Related operators
Examples
LESS_THAN_OR_EQUALS — functional call
FeatureQL
SELECT
-- Equality branch
f1 := LESS_THAN_OR_EQUALS(3, 3),
-- Strictly greater is false
f2 := LESS_THAN_OR_EQUALS(4, 3)
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
LESS_THAN_OR_EQUALS — chained
FeatureQL
SELECT
-- Dot form: receiver is the left-hand operand
f1 := (3).LESS_THAN_OR_EQUALS(3),
-- Same semantics as the prefix call
f2 := (4).LESS_THAN_OR_EQUALS(3)
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |