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

Home -> Community -> Usenet -> c.d.o.server -> Re: GROUP BY DAY.... problem.

Re: GROUP BY DAY.... problem.

From: Haximus <e_at_t.me>
Date: Sun, 27 Feb 2005 20:08:03 GMT
Message-ID: <DMpUd.9353$hN1.7453@clgrps13>

> You're going to have to break down the date/time component into something
> you can group by, i.e extract the hour and minutes as calculated columns
> and GROUP BY hour. If you only want the rage HH:01 to HH+1:00 you're
> going to have to get fancy and use the modulus function, or some other
> method to derive your hourly grouping factor.

To be more specific, try:

SELECT MOD( EXTRACT( HOUR FROM LOCALTIMESTAMP ) * 60 + EXTRACT( MINUTE FROM LOCALTIMESTAMP ), 15 ) FROM DUAL All you need really is to get the minutes of the day or absolute minutes, then use mod 15 or 60 or whatever to get a group by interval for aggregation. Offset the minutes by adding one if you want HH:01 to HH+1:00 Received on Sun Feb 27 2005 - 14:08:03 CST

Original text of this message

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