Back to Browse

From Excel to SQL - Pivot Tables (ROLLUP)

88 views
Feb 29, 2024
10:00

To continue from the last video on aggregations, we saw that our aggregates in SQL didn't have any subtotals or a grand total by default. In this video, we update our GROUP BY clause to include the subtotals and grand totals in our output! Note that if you're not using Microsoft SQL Server, check out the documentation for your SQL flavour to see whether ROLLUP is supported. The dbfiddle website can be accessed for free and without an account at: - https://dbfiddle.uk/ Make sure to use the SQL Server dialect and the AdventureWorks sample database to be able to follow along with these examples! --------------------------------------------------- This is part of the From Excel to SQL playlist, available at: - https://www.youtube.com/playlist?list=PLEiRgvTilK5rhnVPQ_Tj3Q-CI0rGn_uiD Check out the previous video at: - https://youtu.be/Tlckp6UbmQE ...and the next video at: - https://youtu.be/xG5CqLICKcY The written version of this content is also available at: - https://billwallis.github.io/sql-learning-materials/from-excel-to-sql/main-concepts/rollup/ --------------------------------------------------- CHAPTERS 00:00 dbfiddle 00:28 Intro 01:04 Recap on GROUP BY 04:05 Adding subtotals and grand totals (Excel) 04:50 Adding subtotals and grand totals (SQL) 06:57 Column order is significant 08:20 ROLLUP isn't in every SQL flavour 09:02 Wrap Up

Download

0 formats

No download links available.

From Excel to SQL - Pivot Tables (ROLLUP) | NatokHD