A compound expression is an expression composed of various types of expressions combined through arithmetic operations, bitwise operations, or grouping with parentheses.
The syntax for a compound expression is as follows:
{ simple_expr
| bit_expr { + | - | * | / | % | MOD | DIV } bit_expr
| bit_expr { & | | | ^ } bit_expr
| bit_expr { << | >> } bit_expr
| bit_expr { + | - } INTERVAL expr date_unit
}
Where:
- The arithmetic operators
+,-,*,/,%(orMOD), andDIVare used to perform calculations between twobit_exprvalues. - Bitwise operators
&(AND),|(OR),^(XOR),<<(left shift), and>>(right shift) are used for integer expressions. bit_expr + INTERVAL expr date_unitandbit_expr - INTERVAL expr date_unitare used for date and time operations. For more information, see Date and time expressions.
You can use any built-in function as a simple expression to construct compound expressions.
The following are some examples of valid compound expressions:
(1 + 2) * 3LENGTH('OCEANBASE') * 2(salary + bonus) * 1.1NOW() + INTERVAL 7 DAY
