title: Is there a way to find the sum and the cumulative count in this MYSQL query?
body: <p>I have this MYSQL query i'm using to find the cumulative growth of a table <code>groups</code> in its associated table <code>members</code> over time.   </p>
  
  <pre><code>  SELECT DISTINCT g.name, m.created_at,
             COUNT(*) OVER(PARTITION by g.id ORDER BY m.created_at) count
      FROM members m
      INNER JOIN groups g on g.id = m.group_id
  </code></pre>
  
  <p>This gives a result set like:</p>
  
  <pre><code>[
    { 'group01', date: '2019-03-04', count: 5 },
    { 'group01', date: '2019-03-09', count: 12 }
    { 'group01', date: '2019-03-15', count: 23 }
    { 'group02', date: '2019-03-04', count: 3 }
    { 'group01', date: '2019-03-10', count: 19 }
    { 'group01', date: '2019-03-17', count: 27 }
  ]
  </code></pre>
  
  <p>I would also to retrieve the total count of a groups members as well. Such that the data set would look like:</p>
  
  <pre><code>[
    { name: 'group01', date: '2019-03-04', count: 5, total: 23 },
    { name: 'group01', date: '2019-03-09', count: 12, total: 23 },
    { name: 'group01', date: '2019-03-15', count: 23, total: 23 },
    { name: 'group02', date: '2019-03-04', count: 3, total: 27 },
    { name: 'group02', date: '2019-03-10', count: 19, total: 27 },
    { name: 'group02', date: '2019-03-17', count: 27, total: 27 }
  ]
  </code></pre>
  
  <p>I need to do this so that at a later point i can easily order &amp; find the top  groups in terms of members. </p>
  
  <p>Is there any way to do this? </p>