Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Group-function SUM on time (date-field)
My assumption is that this is a class project. So the advice is
predicated on that assumption:
Sum the duration and group by the user.
Likely you will want to explore information on date-math and functions and you will need to figure out how to work with the times and not the dates.
Daniel Morgan
Thomas Stuefer wrote:
> Hi !
>
> I use Oracle 8.1.7.2.7 and have a simple table:
>
> user VARCHAR2(30)
> duration DATE
>
> The data in this table looks like:
>
> USER DURATION
> ------------------------------------------------
> SCOTT 01.04.2002 01:30:00
> ADAMS 01.03.2002 00:45:00
> MILLER 01.04.2002 01:35:00
> SCOTT 01.04.2002 00:50:00
> SCOTT 01.02.2002 00:30:00
> MILLER 01.03.2002 00:10:00
> ADAMS 01.04.2002 00:20:00
> MILLER 01.02.2002 00:30:00
>
> How can I get the group-summary of duration on every user:
>
> USER SUM_DURATION
> ------------------------------------------------
> ADAMS 01:05:00
> MILLER 02:15:00
> SCOTT 02:50:00
>
> Remark: The date in the field "duration" is not important and can be
> ignored.
>
> Many thanks for your help !
>
> Thomas
Received on Wed Apr 24 2002 - 10:29:03 CDT