
--explain
 select count(hitID)/6 AS "Average hits per day pi.dk"
 from Hit
 where hitdatetime > '2000-05-06 00:00:00'
 and hitdatetime < '2000-09-18 00:00:00'
 and CustomerID = (select customerid from customer 
     where Customertext='domain01287.gov')
;

--explain
 select count(hitID)/7 AS "Average hits per day"
 from Hit
 where hitdatetime > 'now'::datetime-'1 week'::interval
 and hitdatetime < 'now'::datetime
 and CustomerID = (select customerid from customer 
     where Customertext='odder-campingcenter.dk')
;
