title: Mysql results return ungrouped
body: <p>I have a database table <code>thanks_entry</code> 
  with columns</p>
  
  <pre><code> - entryid
   - varname
   - userid
   - contenttype
   - contentid
   - dateline
   - receiveduserid
  </code></pre>
  
  <p>this table stores the data for likes/thanks given/received to user/by user<br>
  I want to get statistics for users with most likes/thanks per month   </p>
  
  <p><strong>Query:</strong> </p>
  
  <pre><code>SELECT receiveduserid,COUNT(receiveduserid) AS receivedthanks 
  FROM thanks_entry 
  WHERE varname ='likes' AND dateline &gt; 1420070400 
  AND dateline &lt;1422748800 
  GROUP BY userid ORDER BY COUNT(receiveduserid) DESC LIMIT 20
  </code></pre>
  
  <p>This query should return results grouped by userid .. but looking in the result I find   </p>
  
  <pre><code>- receiveduserid|receivedthanks
   - 185883|190
   - 43455|100
   - 163068|85
   - 2|66
   - 186270|49
   - 189468|34
   - 105597|22
   - 2|17
   - 186270|17
   - 163068|16
   - 117147|15
   - 186270|15
   - 186270|14
   - 186643|13
   - 2|12
   - 189170|12
   - 118500|8
   - 2|8
   - 105597|8
   - 2|7
  </code></pre>
  
  <p>As you notice here Although I <code>grouped by receiveduserid</code> .. <code>receiveduserid 2</code> is not grouped and appears multiple times in results ..
  what I'm doing wrong ?  </p>