Operator precedence rules

EQL enforces the following precedence rules for operators.

The rules are listed in descending order:
  1. Parentheses (as well as brackets in lookup expressions and IN expressions). Note that you can freely add parentheses any time you want to impose an alternative precedence or to make precedence clearer.
  2. * /
  3. + -
  4. = <> < > <= >=
  5. IS (IS NULL, IS NOT NULL, IS EMPTY, IS NOT EMPTY)
  6. BETWEEN
  7. NOT
  8. AND
  9. OR

All binary operators are left-associative, as are all of the JOIN operators.

Comparisons with sets

When comparing values against sets (multi-assign data), you must use the appropriate set functions and expressions.

For example, if Price is a single-assign double attribute, then this syntax is correct:
RETURN Results AS
SELECT Price AS prices
WHERE Price > 20
However, if Score is a multi-assign integer attribute, then this syntax will fail:
RETURN Results AS
SELECT Score AS ratings
WHERE Score > 80
The error message will be:
In statement "results": In WHERE clause: Cannot compare 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).

You therefore must re-write the query, as in this example:
RETURN Results AS
SELECT Score AS Ratings
WHERE SOME x IN Score SATISFIES (x > 80)

This example uses an existential quantifier expression.