Tuesday, January 09, 2018

Creating a Microsoft Excel-Style Pivot Table With Grand Totals in SQL

DZone Database Zone
Creating a Microsoft Excel-Style Pivot Table With Grand Totals in SQL
Creating a Microsoft Excel-Style Pivot Table With Grand Totals in SQL

This answer to a beautiful Stack Overflow question I've given recently needs further explanation in a blog post. When working with Microsoft Excel, we can create beautiful and also very insightful pivot tables with grand totals. What are they? This is best explained visually.

Assuming you have this normalized form for your raw data. As in the question, it's an inventory table in a bike shop:

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...