LESS_THAN()

All functions > COMPARISON > LESS_THAN()

Returns TRUE if the first value is strictly less than the second value

Signatures

Returns: TRUE or FALSE according to the comparison, or NULL if either operand is NULL

LESS_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, earlier dates are "less than" later dates
  • For ARRAY and ROW, ordering is lexicographic / field-by-field when types align
  • Supports optional decimal precision for numeric comparisons

Related operators

Examples

LESS_THAN — functional call

FeatureQL
SELECT
    f1 := LESS_THAN(1, 2), -- `LESS_THAN(expr1, expr2)` matches infix `<`
    f2 := LESS_THAN(2, 1) -- False when the first value is not less
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

LESS_THAN — chained

FeatureQL
SELECT
    f1 := (1).LESS_THAN(2), -- Dot form: receiver is the left-hand operand
    f2 := (2).LESS_THAN(1) -- Same semantics as the prefix call
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

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