-- This query gets the Web hits for a given quarter (2012-Q1) for a given Web product (DR8) in the LogSource table.

select count(*) as Hits 
into mydb.Q1HitsDR8 
from Weblogall s join logsource l on s.logid=l.logid
where s.yy = 2012 and (s.mm between 1 and 3) and l.product='DR8'
