title: Get monthly report in sql
body: <p>I got in my data base colums logs, data, type
  How to get logs from year from now with month distinction
  f.ex:
  row</p>
  
  <pre><code>logs = 'error...'
  data = 2012-11-05 11:24:08
  type = 1
  </code></pre>
  
  <p>....
  And I want get them in that view</p>
  
  <pre><code>month     logs-count   type
  January     100         1
  January     100         2
  February    160         1
  February    120         2
   ....
  </code></pre>