Condition precedence is the order in which OceanBase Database evaluates different conditions in the same expression.
For an expression with multiple conditions, OceanBase Database evaluates conditions with higher precedence before evaluating those with lower precedence. OceanBase Database evaluates conditions with equal precedence from left to right within an expression. However, for multiple conditions joined by AND and OR, OceanBase Database does not evaluate them from left to right, but first evaluates the conditions joined by AND and then those joined by OR.
The following table lists the SQL conditions in descending order of precedence. Conditions listed on the same line have the same precedence.
| Condition type | Feature |
|---|---|
| SQL operators are evaluated before SQL conditions | For more information, see Operator precedence. |
| =, !=, <, >, <=, >= | Comparison |
| IS [NOT] NULL, LIKE, [NOT] BETWEEN, [NOT] IN, EXISTS, IS OF | Comparison |
| NOT | Logical negation |
| AND | Conjunction |
| OR | Disjunction |