Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Compute difference between timestamps
Michel Cadot wrote:
> <c8s3dw_at_verizon.net> a écrit dans le message de news: 1149377499.120834.262480_at_j55g2000cwa.googlegroups.com...
>
> SQL> select t2-t1 d1, to_char(extract(second from t2-t1),'990.000') d2 from t;
> D1 D2
> ------------------------------ --------
> +000000000 00:00:26.719000 26.719
>
> 1 row selected.
>
> Regards
> Michel Cadot
That only works if the interval is less than 60 seconds.
SQL> update t set t2 = systimestamp;
1 row updated.
SQL> commit;
Commit complete.
SQL> select t1, t2, t2-t1 d1, to_char( extract ( second from t2 - t1 ), '990.000' ) d2 from t;
T1 T2 D1 D2 ---------------------------- ---------------------------- -------------------------- ------
![]() |
![]() |