EQL enforces the following precedence rules for operators.
IN
expressions). Note that you can freely add parentheses any time you want to impose an alternative precedence or to make precedence clearer.IS
(IS NULL
, IS NOT NULL
, IS EMPTY
, IS NOT EMPTY
)IN
BETWEEN
NOT
AND
OR
Except for IN
, the binary operators are left-associative, as are all of the JOIN
operators. IN
(for set membership) is not associative (for example, writing x IN y IN z
results in a syntax error.)
Comparisons with sets
When comparing values against sets (multi-assign data), you must use the appropriate set functions and expressions.
RETURN Results AS SELECT Price AS prices FROM ProductsState WHERE Price > 20
RETURN Results AS SELECT Score AS ratings FROM ProductsState WHERE Score > 80
In statement "Results": in WHERE clause: The comparison operators are not defined on arguments of types mdex:long-set and mdex:long
The error message means that Score is a set (an mdex:long-set
data type) and therefore cannot be compared to an integer (80, which is an mdex:long
data type).
RETURN Results AS SELECT Score AS Ratings FROM ProductsState WHERE SOME x IN Score SATISFIES (x > 80)
This example uses an existential quantifier expression.