View Single Post
  #3 (permalink)  
Old 07-02-09, 08:58
shajju shajju is offline
Registered User
 
Join Date: Aug 2008
Posts: 332
The query is:

select datetime,
sum(orig_count) "Orig Total",
sum(term_count) "Term Total",
sum(orig_count)+ sum(term_count) "SMS Tot",
round( ( sum(orig_count)+sum(term_count) ) / 3600, 2) avg
from schema.table
where datetime between trunc(sysdate)-1 and trunc(sysdate)-1/24
and caption not in ('mar2','mar1','QO11','QO21','QO31')
group by datetime
Reply With Quote