title: Counting results in MySQL with highest value by category
body: <p>Here is my <code>table</code></p>
  
  <p><a href="http://www.sqlfiddle.com/#!2/47e2d/8" rel="nofollow">http://www.sqlfiddle.com/#!2/47e2d/8</a></p>
  
  <pre><code>╔════╦══════════╦════════╦═══════╦════════╗
  ║ id ║ category ║ userid ║ users ║ points ║
  ╠════╬══════════╬════════╬═══════╬════════╣
  ║ 1  ║    2     ║  91    ║ user1 ║  100   ║
  ║ 2  ║    3     ║  92    ║ user2 ║   80   ║
  ║ 3  ║    4     ║  93    ║ user3 ║   10   ║
  ║ 4  ║    4     ║  91    ║ user1 ║   12   ║
  ╚════╩══════════╩════════╩═══════╩════════╝
  </code></pre>
  
  <p>How do I get the count result of users with the highest points per category?</p>
  
  <p>In the above example, I want to get</p>
  
  <pre><code>user1: 2
  user2: 1
  </code></pre>
  
  <p>After searching for similar problems in stackoverflow for some time, I came up with </p>
  
  <pre><code>SELECT users, COUNT(*) 
  FROM `table` 
  WHERE points=(SELECT MAX(points) FROM `table`) 
  GROUP BY points;
  </code></pre>
  
  <p>But it does not produce what I want.</p>