![]() | Postgres: crosstab pivot table not working as advertised |
|
10 Nov 2012, 14:25
Chad Ostrowski (8 posts) |
I inserted a bunch of extra events, so my events-by-month-and-year should have three rows for three years. This is my crosstab code (which matches page 34 of the book exactly, as far as I can see):
But this is the result:
I can’t see any differences between the events in different months of the same year that would make them be grouped differently. What’s going on? |
|
05 Dec 2012, 15:35
Aaron McBride (4 posts) |
I had a similar problem and found the answer to this post to be helpful in this case: http://forums.pragprog.com/forums/202/topics/10557 Slap an “ORDER BY year, month” on the first query passed to crosstab(). |
| You must be logged in to comment |

