Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Compute difference between timestamps
so I do that:
SQL> create table t ( t1 timestamp, t2 timestamp );
Table created.
SQL> insert into t ( t1 ) values ( systimestamp );
1 row created.
SQL> update t set t2 = systimestamp;
1 row updated.
and get an interval, which is not what I asked for:
SQL> select ( t2 - t1 ) / ( 24 * 60 * 60 ) from t;
(T2-T1)/(24*60*60)
Sybrand Bakker wrote:
> On 3 Jun 2006 11:06:51 -0700, c8s3dw_at_verizon.net wrote:
>
> >In Oracle database, given two timestamp columns, how do I compute the
> >difference, expressed in seconds, to three decimal places? i.e. 452.936
>
> Just subtract them, and divided them by the number of seconds per day.
>
> --
> Sybrand Bakker, Senior Oracle DBA
Received on Sat Jun 03 2006 - 18:31:39 CDT