Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: sql query
see answer below
> -----Original Message-----
> From: Ravindra Basavaraja [mailto:ravindra_at_sentica.com]
>
> I want to get count of records that are generated every hour.(group by
> hour).
> Since the date field will have timestamp varying every second
> how do I group
> a set of records for every hour.
>
> Like
>
> count(*) Time(in hour)
> ------- -------------
> 10 00-01
> 20 01-02
> 30 02-03 like wise for every hour.
>
> Can i do this by using the GROUP BY clause.If so pls help me.
Read the manual on the TRUNC function as it applies to date. Your group by would be "group by trunc (date_field, 'HH24')" Received on Mon May 07 2001 - 13:59:09 CDT
![]() |
![]() |