Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: group by hour?

Re: group by hour?

From: <Kurt.Bachmann_at_t-online.de>
Date: 1997/04/13
Message-ID: <5iq3nr$kqb$1@news01.btx.dtag.de>#1/1

On Tue, 08 Apr 1997 14:30:08 -0400, edwards_at_garland.dnr.state.sc.us wrote:

>is it possible to group by the hour or day of a date?
>
> select avg(temperature),date from weather
> group by date%DAY
>
>Does anyone know how to do this?

Here is an example with group by hours:
select to_char(DATUM,'yyyymmddhh24'), count(*) from TABELLE where DATUM>=to_date('19960206000000','yyyymmddhh24miss') and

      DATUM<to_date('19960207000000','yyyymmddhh24miss') group by to_char(DATUM,'yyyymmddhh24'); Received on Sun Apr 13 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US