title: group by month of unix timestamp field
body: <p>I'm trying to get my code to output in the following format:</p>
  
  <pre><code>january 2012 - 34
  february 2012 - 23
  </code></pre>
  
  <p>where 34 and 23 would be a count of the total rows that fall within that month that have the id_dealership of 7. I need this to output all data for every month that an assignment was ever made.</p>
  
  <p>The <code>assignments</code> table structure is as follows:</p>
  
  <pre><code>id_dealer (int)
  date_assigned (int)
  </code></pre>
  
  <p>I've tried this but it does not work at all:</p>
  
  <pre><code>SELECT MONTH(date_assigned), YEAR(date_assigned), COUNT(*)
  FROM assignments
  GROUP BY MONTH(date_assigned), YEAR(date_assigned)
  </code></pre>