Title: RE: sql query

see answer below

> -----Original Message-----
> From: Ravindra Basavaraja [mailto:[EMAIL PROTECTED]]
>
> 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')"

Reply via email to