Operator Precedence (Entity SQL)
When an Entity SQL query has multiple operators, operator precedence determines the sequence in which the operations are performed. The order of execution can significantly affect the query result.
Operators have the precedence levels shown in the following table. An operator with a higher level is evaluated before an operator with a lower level.
When two operators in an expression have the same operator precedence level, they are evaluated left to right, based on their position in the query. For example,
x+y-z is evaluated as
You can use parentheses to override the defined precedence of the operators in a query. Everything within parentheses is evaluated first to yield a single result before that result can be used by any operator outside the parentheses. For example,
z and then adds
y and then multiplies the result by