title: how to sort and group by by it's count
body: <p>I have the following:</p>
  
  <pre><code>SELECT DISTINCT s.username, COUNT( v.id ) AS cnt
  FROM  `instagram_item_viewer` v
  INNER JOIN  `instagram_shop_picture` p ON v.item_id = p.id
  INNER JOIN  `instagram_shop` s ON p.shop_id = s.id
  AND s.expirydate IS NULL 
  AND s.isLocked =0
  AND v.created &gt;=  '2014-08-01'
  GROUP BY (
  s.id
  )
  ORDER BY cnt DESC 
  </code></pre>
  
  <p>Basically I have an instagram_item_viewer with the following structure:</p>
  
  <pre><code>id  viewer_id  item_id  created
  </code></pre>
  
  <p>It tracks when a user has viewed an item and what time. So basically I wanted to find shops that has the most items viewed. I tried the query above and it executed fine, however it doesn't seem to give the appropriate data, it should have more count than what it is. What am I doing wrong?</p>