August 2002
Intermediate to advanced
528 pages
10h 12m
English
The ROLLUPs that we have seen are a small percentage of the numerous possible combinations. For example, the ROLLUP option in Listing 9.1 computed subtotals for gender. Suppose the business analyst wanted to get subtotals for Department while still rolling up the costs of gender per department. This would require the GROUP BY clause to change to the following:
Group by rollup (department, gender)
Suppose the business analyst also wanted to subtotal costs for gender and department. This cannot be done with the ROLLUP option because the SELECT clause can contain only one GROUP BY clause (and only one ROLLUP option). The CUBE option must be used instead.
The CUBE option will compute subtotals for all expressions placed within the parameter ...