An expression list is a combination of expressions separated by commas, named expr_list in the syntax.
The syntax for the expression list is as follows:
expr [, expr ]...
The syntax for the row value constructor is as follows:
ROW ( expr [, expr ]... )
Expression lists can appear in IN conditions and in the GROUP BY clause of queries. The expression list in an IN condition is sometimes referred to as a row constructor.
Usage instructions
- In the
INcondition, the list of expressions within parentheses represents the set of candidate values. ROW(expr [, expr ]...)is used to explicitly construct a row value. Its syntax is equivalent to(expr [, expr ]...).
Examples
The following example lists some valid expressions:
obclient> (100, 200, 300)
obclient> ('SCOTT', 'BLAIR', 'MARK')
obclient> ROW(1, 'apple', 'red')
In the GROUP BY clause, the expression list is represented as follows:
obclient> SELECT dept_id, MIN(salary) min, MAX(salary) max FROM emp
GROUP BY dept_id, salary
ORDER BY dept_id, min, max;
