title: count a specific row on a nested query
body: <p>I'm trying to count the number of records on a particular field with the query below.</p>
  
  <pre><code>SELECT COUNT(DISTINCT CASE WHEN seen='n' and reciever_id=1 THEN 'varb' ELSE  'novarb' END) AS count ,c.id, c.vmsg, c.sender_id, p.fname, p.lname, p.profile_pix, p.profile_id
  FROM chats c LEFT JOIN profile p  ON c.sender_id = p.profile_id
  WHERE c.reciever_id = 1 AND c.id in (SELECT MAX(c.id) as id FROM  chats c
  GROUP BY c.sender_id )
  </code></pre>
  
  <p>But the answer i get only returns it just one record whiles there other hundreds to be displayed</p>