title: MySQL Query GROUP BY day / month / year
body: <p>Is it possible to make a simple query to count how many records I have in a determined period of time like a year, month, or day, having a <code>TIMESTAMP</code> field, like: </p>
  
  <pre><code>SELECT COUNT(id)
  FROM stats
  WHERE record_date.YEAR = 2009
  GROUP BY record_date.YEAR
  </code></pre>
  
  <p>Or even:</p>
  
  <pre><code>SELECT COUNT(id)
  FROM stats
  GROUP BY record_date.YEAR, record_date.MONTH
  </code></pre>
  
  <p>To have a monthly statistic. </p>
  
  <p>Thanks!</p>