I posted question but still haven't got problem solved, please help

I have a table which has two columes
time- timestamp
value- integer
I have problem writing query to get rolling up cumulative of value for time buckets
Wanted results like following:
like cumulative value for rolling 5 minutes time bucket for past 1 hour
If current time is 8:51:00
value cumulative value
8:51:00 3 256
8:46:00 4 253
8:01:00 3 14
7:56:00 6 11
7:51:00 5 5
user want the time bucket can set to 5min, 1 hours, 1 day
and the data can be refreshed every 1 min. Is there some way we can get live rolling time bucket like
if currenct time is 3/18/2006 11:07:23 am, the interval(Time bucket) send to 1 hour. Results like following
count(*) interval interval3
187 88 3/18/2006 10:07:00 AM
280 87 3/18/2006 09:07:00 AM
34 86 3/18/2006 08:07:00 AM
1 mins later. time is 3/18/2006 11:07:23 am. refresh data, the result like
count(*) interval interval3
188 88 3/18/2006 10:08:00 AM
282 87 3/18/2006 09:08:00 AM
36 86 3/18/2006 08:08:00 AM
Is it possible?
Thanks a lot
previous question link
Re: Help about rolling cumulative sum in time bucket

The referenced thread had a much better subject line.
Question can the number of required buckets that are brought back be limited to say 12? If you can limit the result set to a fixed number of buckets then you should be able to just use a group by on a case statement with a little date/time math in it. That is you would be able to calculate the time boundries from the present and then compare the row data timestamps to the boundries.
With a variable number of buckets you would need to find the difference in the desired units (5 min, 1 hour, days ? 24 hours) between the current_timestamp and the oldest timestamp in the data. You would then need to calculate the boundries and compare the data. Doing all this would be more resource intensive than the group by the case test.
HTH -- Mark D Powell --

Similar Messages

Maybe you are looking for

  • Palm Desktop "hiding" some of my new events

    I've used Palm Desktop for about two years on my old laptop and had no problems. Now that I got a new laptop and couldn't find the intall CD, I had to download the Desktop package off the website (Windows XP Home version). I went to add in new events

  • IDVD won't burn

    So iDVD refuses to burn the disc. Up until it tells us to insert a recordable DVD, everything is fine-then when we insert a recordable DVD, it takes it for a few seconds, then spits it back out without any kind of reason whatsoever. Help?

  • I installed CS5.5 Design Premium - can I uninstall  CS5?

    Hello, I successfully installed CS5.5 Design Premium in my computer but the CS5 version still exists in my drive causing a visual mess. Can I uninstall it? Will it harm my CS5.5 installation? How do I uninstal? Thanks, Juan

  • YUI Menu Help, menu greyed out

    Hi, I love the look of YUI Menu, unfortunately, Menu item 2 continues to be greyed out and not functional. I've tried reloading it and still get the same behavior. help??

  • C6 call divert issues

    Hello, earlier today I was on the phone to my friend, my dad came home later on saying he had been trying to ring me, whilst I had been on the phone to my friend I had no incoming call things, I tried to sort it out, I went on settings, calling, call