2 ms·
I agree. This is all about display of the data. However, the point of pivots is getting a two-dimensional display of the data. Using the example from the guide,
by mirimir 9y ago
I agree. This is all about display of the data. However, the point of pivots is getting a two-dimensional display of the data. Using the example from the guide, a simple aggregate query would give you:
Year Month Revenue
2016 01 1
2016 02 23
2016 03 345
... ... ...
2017 01 567
2017 02 1234
2017 03 4567
... ... ...
That's fine, but for some readers, it's hard to see year-to-year changes. With a pivot, you get:
Revenue / Month
Year 01 02 03 ...
2016 1 23 345 ...
2017 567 1234 4567 ...
... ... ... ... ...
Also, for what it's worth, I gotta say that Excel does a great job at pivoting. Better than MySQL, anyway, running on the same hardware. I've created pivots with thousands of columns.