When to use GROUPING SETS, CUBE and ROLLUP
Firstly, for those who haven’t already read up on the subject: Using GROUP BY with ROLLUP, CUBE, and GROUPING SETS That being said, don’t think about these grouping options as ways to get a result set. These are performance tools. Let’s take ROLLUP as a simple example. I can use the following query to get … Read more