title: Mysql: Count records (including zero) per month
body: <p>I am trying to count the records in my table and group them per date. My current query looks something like the following:</p>
  
  <pre><code>SELECT
     count(*), 
     MONTH(time) as month,
     YEAR(time) as year
  FROM
     myTable
  GROUP BY
     month, year
  ORDER BY
     year, month
  </code></pre>
  
  <p>This works, except that I would also like to get a count for months where no records exists. </p>
  
  <p>Could anyone offer advice/suggestions on how to accomplish this?</p>