Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Summary with Group-by function on time (date-field)
>
> select user, to_char(sum(to_number(to_char(duration,'HH24'))) +
> trunc(sum(to_number(to_char(duration,'MI')))/60))
>
||':'||to_char(mod(sum(to_number(to_char(duration,'MI'))),60))||':00'
> as duration
> from test
> group by user;
>
> It takes a while to compute it...
> I am also very curious how many better/easier solutions are out
there.
How about
select user, sum(d - trunc(d)) duration_as_number_of_days
from test
group by user
and format the output as you wish
Peter Laursen Received on Wed Apr 24 2002 - 13:18:53 CDT
![]() |
![]() |