Fast but ugly group-by query for monthly stats per year.