title: Group results by number of days appearing
body: <p>I want to get the number of days someone logs on in a month. Using this query:</p>
  <pre><code>select id,
         to_char(date_on, 'MM-DD') as mon_dd
  from 
         logs
  group by 
         id, to_char(date_on, 'MM-DD')
  </code></pre>
  <p>I get a table that looks like this:</p>
  <pre><code>  id    | mon_dd
      0   | 01-27
      3   | 02-23
      1   | 01-05
      0   | 01-31
      2   | 02-01
      3   | 02-05
      1   | 02-09
  </code></pre>
  <p>I want to get a result that groups the id by the number of days they appear in a month like this:</p>
  <pre><code>      id | month | days_appeared
         0 | jan   | 2
         0 | feb   | 0
         1 | jan   | 1
         1 | feb   | 1
         2 | jan   | 0
         2 | feb   | 1
         3 | jan   | 0
         3 | feb   | 2
    
   
  </code></pre>