Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DATE ARITHMETIC QUESTION
<wagen123_at_yahoo.com> schrieb im Newsbeitrag
news:1106947356.439046.281840_at_f14g2000cwb.googlegroups.com...
> The following query shows the DURATION in seconds.
> SQL> select
> NEXT_TIME,COMPLETION_TIME,(COMPLETION_TIME-NEXT_TIME)*60*60*24 DURATION
> from v$archived_log where sequence# = 18220;
>
> NEXT_TIME COMPLETION_TIME DURATION
> ------------------ ------------------ ----------
> 28-JAN-05 12:28:32 28-JAN-05 12:28:51 19
>
> Is there a way to display the DURATION in the following format
> (HH24:MI:SS) easily ?
>
> NEXT_TIME COMPLETION_TIME DURATION
> ------------------ ------------------ ----------
> 28-JAN-05 12:28:32 28-JAN-05 12:28:51 00:00:19
>
> Thanks
> wagen
>
Many ways. e.g.
select
NEXT_TIME,
COMPLETION_TIME,
TO_CHAR(COMPLETION_TIME - NEXT_TIME + TO_DATE ('20000101', 'YYYYMMDD'),
'HH24:MI:SS') DURATION
...
hth,
Urs Metzger
Received on Fri Jan 28 2005 - 17:48:49 CST