Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Compute difference between timestamps

Re: Compute difference between timestamps

From: <c8s3dw_at_verizon.net>
Date: 3 Jun 2006 16:31:39 -0700
Message-ID: <1149377499.120834.262480@j55g2000cwa.googlegroups.com>


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)



+000000000 00:00:00.000297303

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US