Wednesday, October 18, 2017

How to Work With Pivot Tables in PostgreSQL, Amazon Redshift, BigQuery, and MS SQL Server

DZone Database Zone
How to Work With Pivot Tables in PostgreSQL, Amazon Redshift, BigQuery, and MS SQL Server
How to Work With Pivot Tables in PostgreSQL, Amazon Redshift, BigQuery, and MS SQL Server

All of us have at some point worked with some spreadsheet software, like Excel or Google Sheets, or BI tools and we have to admit that they offer certain functionalities that are very handy when it comes to data presentation and reporting, like the so-called pivot tables. Since many business applications require some sort of pivot tables, I am sure many of you have found themselves struggling with how to satisfy these requirements using a database instead of a spreadsheet.

Unfortunately, for many years, applying the pivot functionality to data in a database table was cumbersome. The main reason for this is that in a typical relational schema, tables are supposed to grow vertically rather than horizontally, repeating value in the same columns when necessary.

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...