title: MySQL GROUP BY date - how to return results when no rows
body: <p>I am writing a query to return the number of blog posts written per day over a certain period of time. My problem arises when there are no records of a blog for a given day. With my query, the result for that day is simply skipped altogether. </p>
  
  <p>Here's my query:</p>
  
  <pre><code>SELECT DATE(`posted`), COUNT(`id`) 
      FROM `blogs` WHERE `status` = 'active' 
      &amp;&amp; `posted` BETWEEN `2011-01-01` AND `2011-05-01` 
      GROUP BY DATE(`posted`)
  </code></pre>
  
  <p>It returns something similar to:</p>
  
  <pre><code>count | date
  _________________
  2     |  2011-01-01
  5     |  2011-01-02
  1     |  2011-01-04
  </code></pre>
  
  <p>Notice that it is missing 2011-01-03 because it doesn't have any posts.</p>
  
  <p>How do I get it to show those days with 0 posts?</p>