Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Groupby based on time and average the value

584873Feb 10 2010 — edited Feb 17 2010
Hi All,

Platform Oracle 11.

I have a table with two columns

sampleInterval - Timestamp
Cnt - number.

This table has rows inserted every minute, with the time of insertion in the sampleinterval column.
Is there a way I can (in sql) get average of all the values of 'Cnt' column on a hourly basis.
In other words I need to get average in the last hour and the one before that and so on...

Any thoughts ?

Thanks
_Pete
( One way I planned to do it was in my java program, but if sql can do it, it would be simpler).
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2010
Added on Feb 10 2010
10 comments
1,292 views