News for hackers. Stuff that matters.
Re:Pivot – Rows to Columns by MarkusWinand on Monday February 05, 2018 @01:55PM (#16311015)
The example still groups by YEAR. So you won't need more than 12 months.

Regardless: SQL is a statically typed language. Also the type of the result—i.e. the names and types of the columns—must be known in advance. Some databases offer extensions for "dynamic pivot".

Re:Pivot – Rows to Columns by mwexler on Monday February 05, 2018 @03:32PM (#16311863)
Markus is modest; he is the author of the top post, and imho is up with Joe Celko in offering great techniques to use SQL effectively (both at http://modern-sql.com/ as above and http://use-the-index-luke.com/). I'm a fan.