By Andrew Gould

Writing SQL for Excel with ADODB playlist https://youtube.com/playlist?list=PLNIs-AWhQzckUd5i0E1xeSFeBAonYIurK
VBA Working with Databases playlist https://youtube.com/playlist?list=PLNIs-AWhQzclbRVLCZlsFvpz6fz2nPGbt

Get files here https://www.wiseowl.co.uk/vba-macros/videos/vba-ado-net-recordsets/sql-excel-consolidate-derived-tables

If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos you can join this channel to get access to perks:
https://www.youtube.com/channel/UCbi5G5PjWBaQUFy7XU_O7yw/join
Or you can click this link https://www.wiseowl.co.uk/donate?t=1 to make a donation. Thanks for watching!

This videos demonstrates how to use derived table subqueries to consolidate multiple worksheets into a single list using the Group By clause and aggregation functions. You'll learn how to nest a Select statement in the From clause of an outer Select statement and how to reference columns from the subquery in the main query. You'll also learn how to apply the Group By clause to the rows returned by the subquery and how to add aggregated values, including grand totals.

Chapters
00:00 Topic List
00:41 The Basic Setup
02:40 Using Union All to Select All Rows
05:06 Creating a Derived Table Subquery
07:46 Adding a Group By Clause
10:00 Calculating More Aggregates
12:02 Grouping by the Source Worksheet
13:46 Adding a Summary Row
15:30 Changing the Grouping
16:08 Sorting the Query Results
19:15 Using a Derived Table to Remove the Helper Column

Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Power BI, DAX, SQL Server, Reporting Services, Analysis Services, Integration Services, ASP.NET, C#, Visual Basic, Microsoft Access and more