title: Mysql count occurrence by group
body: <p>Hi i have following table on mysql DB.</p>
  
  <pre><code>╔═══════════╦═════════╦════════╦════════════════╗
  ║ REVIEW_ID ║ USER_ID ║ STATUS ║   DATE_ADDED   ║
  ╠═══════════╬═════════╬════════╬════════════════╣
  ║       218 ║       2 ║ cool   ║ 20130121134811 ║
  ║       218 ║       2 ║ cool   ║ 20130121134812 ║
  ║       218 ║       2 ║ lame   ║ 20130121134813 ║
  ║       218 ║       2 ║ funny  ║ 20130121134814 ║
  ║       218 ║       2 ║ funny  ║ 20130121134815 ║
  ║       218 ║       2 ║ funny  ║ 20130121134816 ║
  ║       218 ║       2 ║ lame   ║ 20130121134817 ║
  ╚═══════════╩═════════╩════════╩════════════════╝
  </code></pre>
  
  <p>how can i get a result where when i do query based on <code>user_id</code> i need to get result of total status for each type:</p>
  
  <pre><code>╔════════╦════════════╗
  ║ STATUS ║ TOTALCOUNT ║
  ╠════════╬════════════╣
  ║ cool   ║          2 ║
  ║ funny  ║          3 ║
  ║ lame   ║          2 ║
  ╚════════╩════════════╝
  </code></pre>
  
  <p>Thanks</p>