Multidimensional reporting with CROSS APPLY and PIVOT in MS SQL Server
In this post we’re going to demonstrate how to use PIVOT relational operator to transform data from table-valued into another table. As an example we will use simple Data Warehouse (DWH) that stores annual company reports for harvesting fruits. The goal is to display report showing annual reports of sold fruits for each year.