An expression list is a combination of other expressions.
Expression lists can appear in comparison and membership conditions and inGroup
By
Clauses of queries and subqueries.
Comparison and membership conditions appear in the conditionsWhere
Clauses. They can containEitherOne or more comma-delimited expressions, or one or more sets of expressions where each set contains one or more comma-delimited expressions. In the latter case (multiple sets of expressions ):
- Each set is bounded by parentheses
- Each set must contain the same number of expressions
- The number of expressions in each set must match the number of expressions before the operator in the comparison condition or before
In
Keyword in the membership condition.
A comma-delimited list of expressions can contain no more than 1000 expressions. A comma-delimited list of sets of expressions can contain any number of sets, but each set can contain no more than 1000 expressions.
The following are some valid expression lists in conditions:
(10, 20, 40) ('Scott ', 'bucke', 'taylor') ('guy', 'himuro', 'ghimuro'), ('karen ', 'colmenares', 'kcolmena '))
In the third example, the number of expressions in each set must equal the number of expressions in the first part of the condition. For example:
Select * from employees where (First_name, last_name, email) In (('Guy', 'himuro', 'ghimuro'),('Karen ', 'colmenares', 'kcolmena'))
See also: "Comparison conditions" and "membership conditions" |
In a simpleGroup
By
Clause, you can use either the upper or lower form of expression list:
Select department_id, min (salary), max (salary) from employees group by department_id, salary; select department_id, min (salary), max (salary) from employees group by (department_id, salary );
InRollup
,Cube
, AndGrouping
Sets
ClsesGroup
By
Clures, you can combine individual expressions with sets of expressions in the same expression list. The following example shows several valid grouping sets expression lists in one SQL statement:
select prod_category, prod_subcategory, country_id, cust_city, count (*) from products, sales, customers where sales. prod_id = products. prod_id and sales. cust_id = MERs. cust_id and sales. time_id = '01-oct-00' and MERs. cust_year_of_birth between 1960 and 1970 group by grouping sets ( prod_category, prod_subcategory, country_id, cust_city ), ( prod_category, prod_subcategory, country_id ), ( prod_category, prod_subcategory ), country_id );