Condition priority refers to the order in which different conditions in the same expression are evaluated in OceanBase Database.
When computing an expression that contains multiple conditions, the conditions with higher priority are evaluated first, and the conditions with lower priority are evaluated last. For conditions with the same priority, they are evaluated from left to right. However, for multiple conditions connected by AND and OR, they are not evaluated from left to right. Instead, the conditions connected by AND are evaluated first, and the conditions connected by OR are evaluated next.
The following table lists the SQL conditions from the highest to the lowest priority. Conditions listed on the same row have the same priority.
Condition type |
Description |
|---|---|
| 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 | Connection. |
| OR | Separation. |
