title: Group by using month, year in doctrine2
body: <p>How to write a following SQL query in doctrine2 as DQL .</p>
  
  <pre><code>SELECT COUNT(id)  
  FROM stats  
  WHERE YEAR(record_date) = 2009  
  GROUP BY YEAR(record_date), MONTH(record_date)
  </code></pre>
  
  <p>i.e i would like to <code>group by</code> results based on month,year of datetime field stored in MySQL table. </p>