-- This query gets the SQL queries per month for a given database name (pattern).

select yy, mm as mth, count(*) 
into mydb.MonthyUsageDR8 
from sqllogall
where dbname like '%dr8'
group by yy, mm
order by yy, mm