Conditions in Query Language
The query language uses filter criteria that are used to filter data in WHERE, HAVING and JOIN clauses. The following rules describe criteria:
<Filter criterion>
|
<Logical component> [OR <Logical component>]
|
<Logical factor> [AND <Logical factor>]
|
NOT <Logical factor> |
( <Filter criterion> ) |
<Logical expression>
In the simplest case, a criterion is an expression with a result having a logical type value.
Conditions can also be defined as more complex expressions, where simple logical expressions are joined using the logical operators AND, OR, NOT.
Logical operators have the following priorities:
- NOT has the highest priority;
- AND is the next in priority;
- OR has the lowest priority.
Simple logical expressions are calculated first, then NOT, then AND, and finally OR. In order to set another calculation order, you can use parentheses ().