Condition precedence refers to the order in which different conditions are evaluated within the same expression in OceanBase Database.
When evaluating an expression that contains multiple conditions, the system first checks the condition with the higher precedence and then checks the condition with the lower precedence. For conditions with equal precedence, they are evaluated from left to right. For multiple conditions connected by AND and OR, the system evaluates them in the order of AND first and then OR.
The SQL conditions are ranked from highest to lowest priority as follows. Conditions listed in the same row have the same priority.
Condition type |
Feature |
|---|---|
| SQL operators are evaluated before the SQL condition. | For more information, see Operator precedence. |
| =、!=、<>、<、>、<=、>=、<=> | Compare. |
| IS [NOT] NULL、LIKE、REGEXP、SOUNDS LIKE、MEMBER OF、[NOT] BETWEEN、[NOT] IN、EXISTS | Compare. |
| IS [NOT] TRUE、IS [NOT] FALSE、IS [NOT] UNKNOWN | Boolean test. |
| NOT | Logical NOT. |
| AND | Connection. |
| XOR | XOR. |
| OR | Separate. |
