title: Group by on Postgresql Date Time
body: <p>Hy. There are employee records in my postgresql database something like </p>
  
  <pre><code> CODE     DATE       COUNT 
  "3443"   "2009-04-02"  3
  "3444"   "2009-04-06"  1
  "3443"   "2009-04-06"  1
  "3443"   "2009-04-07"  7
  </code></pre>
  
  <p>I want to use a query "SELECT ALL CODES AND COUNT THEM THAT OCCURRED IN THE MONTH"</p>
  
  <p>RESULT:</p>
  
  <pre><code> CODE     DATE     COUNT 
  "3443"   "2009-04"  3
  "3441"   "2009-04"  13
  "3442"   "2009-04"  11
  "3445"   "2009-04"  72
  </code></pre>
  
  <p>I did use a query i.e.</p>
  
  <pre><code>SELECT CODE,date_part('month',DATE),count(CODE)
  FROM employee
  where 
  group by CODE,DATE
  </code></pre>
  
  <p>The above query runs fine but the months listed in the records are in form of numbers and its hard to find that a month belongs to which year. In short I want to get the result just like mention above in the RESULT section. Thanks</p>