Advanced SQL GROUP BY with Grouping Sets

Advanced SQL GROUP BY with Grouping Sets

1.228 Lượt nghe
Advanced SQL GROUP BY with Grouping Sets
Learning about Grouping Sets in SQL will save you time! Most likely you are using the UNION or UNION ALL command to create summary queries and tables. Grouping Sets enable an efficient combination of multiple groupings in one query, saving processing time and reducing code complexity. Unlike other videos, I also teach you to use the GROUPING_ID function so you can order and label all rows that belong to the same grouping. I'll use an Excel dashboard to illustrate my point. Make sure you watch and learn! Join this channel to get access to perks: https://www.youtube.com/channel/UCL2ls5uXExB4p6_aZF2rUyg/join 00:00 Intro 01:28 Review Results in Excel Dashboard 02:50 Data Overview / UNION ALL Example 05:20 More Efficient GROUPING SETS Example 07:55 The Benefits of GROUPING ID 09:28 Identify Grouping Level with a CASE Statement 10:43 Recap ★☆★ FOLLOW ME BELOW: ★☆★ Blog ► https://anthonysmoak.com/ Twitter ► https://twitter.com/AnthonySmoak Facebook ► https://www.facebook.com/AnthonyBSmoak/ Instagram ► https://Instagram.com/@anthonysmoakdata Tableau Public ► https://bit.ly/3JMKsLY