21Performing Complex Calculations on Groups
Before a group can enter the open society, it must first close ranks.
STOKELY CARMICHAEL
Topics in this Chapter
Getting Totals in a Hierarchy Using ROLLUP
Calculating Totals on Combinations Using CUBE
Creating a Union of Totals with GROUPING SETS
In Part IV, I showed you how to summarize and group data. Specifically, in Chapter 12, “Simple Totals,” I showed how to calculate totals, counts, and other aggregate functions, in Chapter 13, “Grouping Data,” I showed how to group data, and in Chapter 14, “Filtering Grouped Data,” I showed both how to filter the grouped ...
Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.