title: count row values as column name mysql
body: <p>I have table <code>user_completed</code></p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `user_completed` (
    `rowId` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `designer_id` int(10) unsigned NOT NULL,
    `status` varchar(54) DEFAULT NULL,
    PRIMARY KEY (`rowId`),
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
  
  
  INSERT INTO `user_completed` (`rowId`, `designer_id`, `status`) VALUES
  (1, 1, accept),
  (2, 1, reject),
  (3, 1, accept),
  (4, 1, reject),
  (5, 1, overtime),
  (6, 2, accept)
  (7, 2, accept)
  (8, 3, accept)
  (9, 2, reject);
  </code></pre>
  
  <p>Which look like:</p>
  
  <pre><code>rowId   designer_id    status 
  1           1          accept
  2           1          reject
  3           1          accept
  4           1          reject
  5           1          overtime
  6           2          accept
  7           2          accept
  8           3          accept
  9           2          reject
  </code></pre>
  
  <p>I want to get result below:</p>
  
  <pre><code>designer_id   accept   overtime   reject
  1             2        1          2
  2             2        0          1
  3             1        0          0
  </code></pre>
  
  <p>But I have no idea how to group <code>designer_id</code> then count distinct <code>status</code> and each into columns like above.</p>