[SOLVED]MySQL Query Problem
Posted: Thu Sep 15, 2005 9:47 am
I got a hitcounter table for webmaster (ID between 1000 and 3000) referals. It contains ID, timstamp, IP
Now I want to get the number of hits and uniques for each webmaster in the system even if it is 0
So I got this query working:
This works fine except that I need to get another Where clause in. I need to get only those counted between two different timestamps.
If I simply add this I get all active webmasters but not the ones who got no hits or uniques.
How do I add this clause to get the desired result?
Now I want to get the number of hits and uniques for each webmaster in the system even if it is 0
So I got this query working:
Code: Select all
SELECT c.ID, count( DISTINCT w.IP) , count( w.IP) FROM Webmaster c LEFT JOIN Webhits w
ON ( c.ID = w.ID ) WHERE c.ID BETWEEN '1000' AND '3000'
GROUP BY c.Customer_IDCode: Select all
w.Timstamp BETWEEN '$firsttimestamp' AND '$lasttimestamp'How do I add this clause to get the desired result?