Group by GROUPING SETS for custom rollups in Oracle

Tuesday Nov 14th 2006 by Staff

The GROUPING SETS option of GROUP BY lets you generate custom sets of subtotals, without seeing as many rows of output as GROUP BY CUBE. In this tip, Bob Watkins offers code samples of how to use GROUPING SETS.


When you use GROUP BY with the summary functions like COUNT and SUM, you normally don't get multi-level totals. Each unique combination of the columns in the GROUP BY generates a total, but these totals aren't "rolled up" into higher level totals.

The article continues at

Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved