> [greater]
All functions > COMPARISON > > [greater]
Returns TRUE if the first value is strictly greater than the second value
Syntax
expr1 > expr2
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 Functions
Examples
> — typical comparisons
FeatureQL
SELECT
f1 := 5 > 3, -- Numeric
f2 := 'zebra' > 'apple' -- Strings
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | true |
> — arrays and rows
FeatureQL
SELECT
f1 := ARRAY(1, 2, 3, 1) > ARRAY(1, 2, 3), -- Lexicographic; longer can exceed when the prefix is equal
f2 := ARRAY(1, 2, 3) > ARRAY(1., 2., 4.), -- Lexicographic; first difference decides
f3 := ROW(2 AS a) > ROW(1. AS a) -- Row field-by-field; integer/decimal may align per field
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN |
|---|---|---|
| true | false | true |
> — three-valued logic
FeatureQL
SELECT
f1 := NULL::BIGINT > 0 -- NULL compared to value
;Result
| f1 BOOLEAN |
|---|
| NULL |