possible to do a group by on a time interval? (or some other way to do this)

  • From: ryan_gaffuri@xxxxxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 10 Oct 2007 22:11:54 +0000

seselect max(mytimestamp) as time, sum(mymetric) as bytes
from metrictable
where mymetric > ( select max(mymetric) from metrictable) - (1/96)


"mytimestamp" is a timestamp data type. 

I want to get a sum for every 15 minute interval in the table. I will add a 
where clause to limit how far back I want to go. The where clause I have there 
now is just an example. 

tried group by, group by rollup, analytic with a window. 

do i need the model clause? I have never used that. I really do think there is 
a way to do this in straight sql. Been working on it for a while....
--
//www.freelists.org/webpage/oracle-l


Other related posts: