Predicates
Clojure users: note that XTDB predicates all use three-valued logic, as per the SQL spec.
The standard comparators are available:
XTQL | SQL | |
---|---|---|
|
|
less than |
|
|
less than or equal to |
|
|
greater than |
|
|
greater than or equal to |
|
|
equal to |
|
|
not equal to |
|
shorthand for |
-
These apply to any data types that are naturally comparable: numbers, strings, date-times, durations, etc.
-
If any input expression is null, the result will also be null.
-
The XTQL variants are variadic - they can accept any amount of arguments.
e.g.
(<= a b c d)
is short-hand for(and (<= a b) (<= b c) (<= c d))
Greatest / Least
These aren’t strictly predicates - they return the greatest/least value of their arguments respectively:
XTQL | SQL | |
---|---|---|
|
|
returns the greatest value of the provided arguments, by the usual comparison operators |
|
|
returns the least value of the provided arguments, by the usual comparison operators |
-
If any provided argument is null, both of these functions will return null.
Boolean functions
XTQL | SQL | |
---|---|---|
|
|
returns |
|
|
returns |
|
|
returns |
|
|
returns |
|
returns |
|
|
|
returns |
|
returns |
|
|
|
returns |
|
returns |
-
The XTQL variants are variadic - they can accept any amount of arguments.