Walkthrough of a case study of a building a SQL report with very specific requirements.
We look at how to add sub-totals to a query using UNION ALL and talk about why this is not usually a good idea.
We then look at how to achieve the same result with the ROLLUP function.
Finally, we talk briefly about getting to the same place with GROUPING SETS.
#sql #coding #rollup #groupingsets #unionall
5 окт 2024