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 priority and then the one with the lower priority. For conditions with equal priority, they are evaluated from left to right. For multiple conditions connected by AND or OR, the AND operations are evaluated before the OR operations.
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 conditions in an SQL statement. | 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. |
