January 2008
Intermediate to advanced
384 pages
8h 1m
English
OLAP functions add the GROUPING, ROLLUP, and CUBE extensions to the GROUP BY clause. They can be written in older Standard SQL using GROUP BY and UNION operators, so they are really shorthand and not brand-new functionality.
They return a single result set that has mixed levels of aggregation. In some ways, the mixed levels are a violation of “relational purity,” but they are handy for basic hierarchical reporting. You will see those clauses called “super groups” in the literature.
The first member of the family is the GROUPING SET. It is really just shorthand for a UNION of several similar grouped queries. It might be easier to see if we build up the options in this subclause. ...
Read now
Unlock full access