Condition precedence refers to the order in which different conditions are evaluated within the same expression in OceanBase AI 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 and OR, the AND operations are evaluated first, followed by 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 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 | Separation. |