Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Grouping averages by month, day or hour
E Shanahy wrote:
> Hi,
>
> I have a table (using Oracle 8.1.7) which stores 'User Sessions', made
> up of a 'START_TIME' date and an 'END_TIME' date. I would like to
> retrieve data from this table which shows the average session time,
> but I would like the get the average for each hour, day, or month.
> i.e., I would like to ask - "Give me the average session length for
> each hour between X and Y dates" - This should give me a number for
> each hour in the given time range. The averages should be distinct,
> consecutive averages and not moving window averages.
> I'm think it's possible to do this using PARTITION BY, but I'm not
> sure exactly how. Any ideas?
>
> Thanks
> Eoin
Daniel Morgan Received on Mon Oct 07 2002 - 12:06:23 CDT