Lesson 42. Pivoting Data
As functions go, PIVOT is actually pretty wack. I am only bringing it up here because I talk about it again in the solutions section.
This function is so wack, I’m not going to put ANY work into this lesson. I’m going to straight phone it in and just use the exact same code example from the MS documentation.
You have my full permission to make a Thug Life gif out of my professional picture.
A Completely Phoned In Example Of Pivoting Data
In [ ]:
-- Pivot table with one row and five columns
SELECT 'AverageCost' AS Cost_Sorted_By_Production_Days,
, , , , 
SELECT DaysToManufacture, StandardCost
) AS SourceTable
FOR DaysToManufacture IN (, , , , )
) AS PivotTable;