   [web] [SQL] Getting count(count(*)) group by xx?
  I'm storing some traffic data myself in a MySQL database for certain pages on my site.  A row in the table contains an IP, a HitTime, and a Page (URL).  I want to get a reading of the number of unique IP's for a given range of HitTime.  Right now, I do something like this:$IPs = mysql_num_rows(mysql_query("select IP from Hit where HitTime like '2006-06-16%' group by IP"));This is, of course, horrible, since mysql_query returns an entire (potentially large) dataset which I then simply use to get the number of rows in it.  Is there a clean way in SQL to get the number of unique IPs in my table?I tried doing something like:select count(*) from Hit where HitTime like '...' group by IPThis gives me a large recordset of numbers, which I want to count up.  Of course, select count(count(*)) doesn't work, but that's what I want.  Any hints?[Edited by - BeanDog on June 20, 2006 5:35:10 PM]
  Try:select count(DISTINCT IP) from Hit where HitTime like '...'   ;  Right again, Sander!  Thanks, I've never come across that syntax before.   