Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from crosstab(
- 'select extract(year from starts) as year,
- extract(month from starts) as month,
- count(*)
- from events
- group by year, month
- order by year, month',
- 'select * from month_count'
- ) as (
- year int,
- jan int, feb int, mar int, apr int, may int, jun int,
- jul int, aug int, sep int, oct int, nov int, dec int
- ) order by year;
Advertisement