title: MYSQL Wrapping a select statement in a count statment
body: <p>Hi I am having a small issue doing the following. I have a table call analytics. that's all working fine. However when I run the following query</p>
  
  <pre><code>SELECT * FROM analytics 
  WHERE  stamp &gt; date_sub(now(), interval 1 day)
  GROUP BY sessionkey;
  </code></pre>
  
  <p>i get</p>
  
  <pre><code> '20','n2zurgy5wcmiymbcla1hb1fnj0lu5km','2',NULL,'/','2015-06-26 07:14:05'
  </code></pre>
  
  <p>Which is the last insert for that sessionkey.</p>
  
  <p>Now here is the issue - It's not quite what I want, you see my aim is to get the total of unique sessions for that day and return the total.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>SELECT * FROM analytics 
  WHERE  stamp &gt; date_sub(now(), interval 1 day) 
  GROUP BY sessionkey AND date(stamp);
  </code></pre>
  
  <p>But also without luck, even putting count(*) around the * does not seem to help.</p>
  
  <p>So I believe I need to count around the select statement or something like this, but I am not sure. Could someone please point me in the right direction.</p>