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 -> Grouping averages by month, day or hour

Grouping averages by month, day or hour

From: E Shanahy <eoinshanaghy_at_iol.ie>
Date: 7 Oct 2002 06:12:20 -0700
Message-ID: <2bf162fc.0210070512.5fcb9836@posting.google.com>


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 Received on Mon Oct 07 2002 - 08:12:20 CDT

Original text of this message

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