3 ms·
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 n
by MarkusWinand 9y ago
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".
- mwexler 9y agoMarkus 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/ http://modern-sql.com/ as above and http://use-the-index-luke.com/ http://use-the-index-luke.com/). I'm a fan.