
--explain
-- drop view CustCount;
-- create view CustCount as
 select CustomerID, count(hitid) AS cHit 
 into TEMP TABLE CustCount
 from Hit
 where hitdatetime > '2000-04-17 00:00:00'
 and hitdatetime < '2000-04-18 00:00:00'
 group by CustomerID
;

--explain
select CustomerText, chit from Customer CU, CustCount CC
 where CU.CustomerID=CC.CustomerID
 order by chit desc
;

