title: MySQL aggregate by month with running total
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/664700/calculate-a-running-total-in-mysql">Calculate a running total in MySQL</a>  </p>
  </blockquote>
  
  
  
  <p>I'm monitoring the number of users created since 2011 in an application by month for a chart using MySQL and PHP.  As a part of the query I would also like to include a running total.</p>
  
  <pre><code>SELECT
    DATE_FORMAT(created,'%Y%m%d') as 'Date',
    COUNT(item_id) as 'NewUsers'
  FROM AP_user
  WHERE YEAR(created) &gt; 2011
    AND user_groups = '63655'
    AND user_active = 1
    AND userID NOT IN $excludedUsers
  GROUP BY MONTH(created) ASC
  </code></pre>
  
  <p>I'm able to return the "users by month" but how do I include a running total as a part of this query?</p>