How to get hourly count in Oracle sql or pl/slq

jl66
jl66 used Ask the Experts™
on
Have a table T1(ID number(10) primary key, Created date) with the a lot of data
Want to get hourly record counts For example.
5/13/2011
hour    count
0 to 1, 5 records
1 to 2 , 10 records
....
8 to 9 , 1000 records
9 to 10, 5000 reocrds
....
23 to 24, 12 records
5/14/2011
....
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Try this:

select to_char(created, 'YYYY/MM/DD HH24'), count(*)
from table
group by to_char(created, 'YYYY/MM/DD HH24')
order by 1
jl66Consultant

Author

Commented:
Thanks a lot.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial