Is there an easy way to get rid of the "gaps" in the graph? I.e., I want to return percentage as zero if there were no spam posts in the month/year.
I could use FROM spam_cte s LEFT OUTER JOIN counts_cte c ON s.CYear=c.CYear - I do not get zeroes, as I wanted; but at least the graph bi longer has gaps.
@Martin one way to do that is to generate a table with the dates (months, years) you want to report over and then do left outer join with your actual statistics query.