I have the following sql query which I would like to group by date range in weeks. It is a table that records ipAddresses for various pages. I am trying to return total and distinct page hits per week.
SELECT page, count(*) AS total, count(DISTINCT ipAddress) AS ipAddress
date_hit >= '2003-09-03 10:00:00' AND
date_hit < '2003-10-17 10:00:00' AND
page = 'Main'
GROUP BY page
I want to group by date_hit from
'2003-09-03 10:00:00' to '2003-09-10 10:00:00'
'2003-09-10 10:00:00' to '2003-09-17 10:00:00'
and so on....