title: Count the amount of a specific usage in a table
body: <p>That headline does not fit but I cannot think of a better one.</p>
  
  <p>I have the following table:</p>
  
  <pre><code>timestamp | userID | role
  1438953971|    5   | 6 
  1438953982|    5   | 7
  1438953985|    5   | 7
  1438953990|    5   | 3
  1438953999|    5   | 6
  </code></pre>
  
  <p>I would like to have a simple query for the number of roles used. So in this case it should be something like this:</p>
  
  <pre><code>role | used
   6   |  2
   7   |  2
   3   |  1
  </code></pre>
  
  <p>I know that I can do it with PHP (not how yet), but I was "experimenting" with "count(distinct(role)) AS used" but that does not seem right.</p>
  
  <p>Any hint appreciated. </p>