GREATER_THAN
All functions > COMPARISON > GREATER_THAN
Returns TRUE if the first value is strictly greater than the second value
Syntax
GREATER_THAN(expr1: T, expr2: T) → BOOLEAN
sql
Type Parameters:
T
: Any comparable type (numeric, string, date, timestamp, boolean)
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
expr1 | T | Yes | First value to compare |
expr2 | T | Yes | Second value to compare |
digits | ANY | No | Optional decimal precision for numeric comparisons |
Returns
BOOLEAN - TRUE if expr1 > expr2, FALSE otherwise, NULL if either value is NULL
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
- Supports optional decimal precision for numeric comparisons