A simple expression can be a column, a pseudo-column, a constant, or a null value.
The syntax for a simple expression is as follows:
{ [database_name.]table_name.column_name
| column_name
| table_name.*
| literal
| NULL
| + simple_expr
| - simple_expr
| ~ simple_expr
| ! simple_expr
| ( expr )
| ROW ( expr [, expr ]... )
}
Common forms of simple expressions include:
- Column reference:
table_name.column_nameordatabase_name.table_name.column_name, for example,employees.salary. - Constants: Literals such as strings and numbers, for example,
'welcome to OceanBase'and10. - NULL: a null value.
- Unary operators:
+,-,~(bitwise NOT), and!(logical NOT) act on a single simple expression. - Parentheses expression:
(expr)is used to change the operator precedence. - Row constructor:
ROW(expr [, expr ]...)is used to construct a row value.
Note
TRUE and FALSE are not literals in simple expressions. They are used only in boolean test conditions (IS TRUE / IS FALSE). For syntax hierarchy, see Expression syntax.
The following are some examples of valid simple expressions:
employees.first_name'welcome to OceanBase'10-salary
