title: GROUP_CONCAT or SUM with Count(*) inside and GROUP BY in MySQL
body: <p>I currently have this query: </p>
  
  <pre><code>SELECT ((count(*) DIV 20) * 10) AS money_earned 
  FROM ticket 
  WHERE 
      closed_by = 269 AND 
      status = 1 AND
      closed_index &gt;= TO_DAYS("2012/01/01") AND closed_index &lt;= TO_DAYS("2013/01/01")
  GROUP BY closed_index;
  </code></pre>
  
  <p>It yields this:</p>
  
  <pre><code>money_earned
  
  60
  50
  30
  20
  20
  </code></pre>
  
  <p>Is there any way to either sum these rows, or concatenate the resulting rows into a string. I have tried to use GROUP_CONCAT, but get an "invalid use of Group function" error.</p>
  
  <p>Instead, I would like to yield the following in a single query if possible:</p>
  
  <pre><code>money_earned
  180
  </code></pre>
  
  <p>or </p>
  
  <pre><code>money_earned
  60,50,30,20,20
  </code></pre>