GREATER_THAN()
All functions > COMPARISON > GREATER_THAN()
Returns TRUE if the first value is strictly greater than the second value
Signatures
Returns: TRUE or FALSE according to the comparison, or NULL if either operand is NULL
GREATER_THAN(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 comparable types
- NULL comparisons always return NULL (three-valued logic)
- For strings, uses lexicographic (dictionary) ordering
- For dates/timestamps, later dates are "greater than" earlier dates
- For ARRAY and ROW, ordering is lexicographic / field-by-field when types align
- Supports optional decimal precision for numeric comparisons
Related operators
Examples
GREATER_THAN — functional call
FeatureQL
SELECT
f1 := GREATER_THAN(5, 3), -- `GREATER_THAN(expr1, expr2)` matches infix `>`
f2 := GREATER_THAN(1, 9) -- False when the first value is not greater
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
GREATER_THAN — chained
FeatureQL
SELECT
f1 := (5).GREATER_THAN(3), -- Dot form: receiver is the left-hand operand
f2 := (1).GREATER_THAN(9) -- Same semantics as the prefix call
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |