Groupby based on time and average the value
584873Feb 10 2010 — edited Feb 17 2010Hi 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).