title: Mysql query using GROUP_CONCAT()
body: <p>Using following mysql query:</p>
  
  <pre><code>SELECT DATE_FORMAT(time, '%Y-%m-%d') AS time,report,count(ip) AS countip FROM asn_data WHERE DATE_FORMAT(time, '%Y-%m-%d') &gt; '2012-10-31' GROUP BY DATE_FORMAT(time,'%Y-%m-%d'),report;
  </code></pre>
  
  <p>I got following output:</p>
  
  <pre><code>+------------+---------------+---------+
  | time       | report        | countip |
  +------------+---------------+---------+
  | 2012-11-01 | bots          |      76 |
  | 2012-11-01 | openresolvers |      97 |
  | 2012-11-01 | proxy         |      24 |
  | 2012-11-01 | scanners      |       4 |
  | 2012-11-01 | spam          |     881 |
  | 2012-11-02 | bots          |     142 |
  | 2012-11-02 | proxy         |      22 |
  | 2012-11-02 | spam          |     667 |
  | 2012-11-03 | proxy         |       1 |
  +------------+---------------+---------+
  </code></pre>
  
  <p>What will be the query to get the following output:</p>
  
  <pre><code>+------------+-------------+---------------+-------+----------+------+
  | time       | bots        | openresolvers | Proxy | scanners | spam |
  +------------+-------------+---------------+-------+----------+------+
  | 2012-11-01 | 76          | 97            | 24    | 4        | 881  |
  | 2012-11-02 | 142         | 0             | 22    | 0        | 667  |
  | 2012-11-03 | 0           | 0             | 1     | 0        | 0    |
  +------------+-------------+---------------+-------+----------+------+
  </code></pre>