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
ParameterTypeRequiredDescription
expr1TYesFirst value to compare
expr2TYesSecond value to compare
digitsBIGINTNoOptional 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 BOOLEANf2 BOOLEAN
truefalse

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 BOOLEANf2 BOOLEAN
truefalse

Last update at: 2026/05/26 17:22:09