title: mysql group_concat with a count inside?
body: <p>i have 2 tables, users and follows. table follows has a column named status. I would like to count how many follows each user has grouping by the status.</p>
  
  <p>The query below returns a record for each status type for each user.</p>
  
  <pre><code>SELECT users.name as user_name, f.status, count(f.id) 
  FROM users
  JOIN application_follows f ON f.user_id = users.id
  GROUP BY users.id, f.status
  ORDER BY users.id
  </code></pre>
  
  <p>returns something like:</p>
  
  <pre><code>user_name     status     count
  
  mike          new         10
  mike          old         5
  tom           new         8
  tom           old         9
  </code></pre>
  
  <p>but i would like something more friendly like:</p>
  
  <pre><code>user_name     status_count
  
  mike          new,10|old,5
  tom           new,8|old,9
  </code></pre>
  
  <p>tried using group_concat and count but didnt work. Any clues?</p>