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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Group by 10 minutes

584873Mar 9 2010 — edited Nov 27 2012
Hi all,

Oracle 11 g
I have the following table and data

CREATE TABLE dummy_data (
ID number NOT NULL
,test_Timestamp timestamp NOT NULL
);

insert into dummy_data (id,test_TimeStamp) values (1,'08-MAR-10 09.43.30.922000000');
insert into dummy_data (id,test_TimeStamp) values (2,'08-MAR-10 09.46.30.922000000');
insert into dummy_data (id,test_TimeStamp) values (3,'08-MAR-10 09.23.30.922000000');
insert into dummy_data (id,test_TimeStamp) values (4,'08-MAR-10 09.26.30.922000000');
insert into dummy_data (id,test_TimeStamp) values (5,'08-MAR-10 09.13.30.922000000');
insert into dummy_data (id,test_TimeStamp) values (6,'08-MAR-10 09.12.30.922000000');

I need to get the average of id values , grouped by 10 minute interval of test_timestamp values. How can I do that ?

For hourly grouping I did the following and it works, but not sure how to do it for 10 minute interval

select to_char(test_Timestamp, 'yyyy-mm-dd hh24') as ts,
avg(id) as id
from dummy_data
GROUP BY to_char(test_Timestamp, 'yyyy-mm-dd hh24') ;

Thanks
_Pete
This post has been answered by 730428 on Mar 9 2010
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 25 2012
Added on Mar 9 2010
10 comments
13,886 views