Louis Davidson works with three amigos:
To get the total, there are a few ways, which I will demonstrate in the next sections on the aggregation functions,
ROLLUP,CUBE, and thenGROUPING SETS. Grouping sets are the most flexible, in that they let you do what the other two can do, but with more control. But knowing the others is important because it is how most ad hoc queries will be written.
It’s uncommon that I use GROUPING SETS() in my code, but every time I do, I’m thankful that it exists.