Thread: diff between two timestamps.

diff between two timestamps.

From
HK
Date:
Hi all,
    Can i get the difference between two timestamps in seconds.
 If i use
t1 timestamp;
t2 timestamp;
select t1 - t2;
i get something like "10 days" or "00:10".

Can i get the number of seconds elapsed between the two timestamps.
Plz help me. I am trying the first time using the stored procedures.
TIA.

--
luv,
hari
      __
     / /    __  _  _  _  _ __  __         -o)
    / /__  / / / \\// //_// \\ \\/ /         /\\\\  Making things happen
   /____/ /_/ /_/\\/ /___/  /_/\\_\\        _\\_v-

-------------------------------------------------------------------
Midas Communications (p) Ltd,
Chennai.
Ph (O) 24512050. Extn : 321
Ph (R) 26161105.


Re: diff between two timestamps.

From
Harry Broomhall
Date:
HK writes:
> Hi all,
>     Can i get the difference between two timestamps in seconds.
>  If i use
> t1 timestamp;
> t2 timestamp;
> select t1 - t2;
> i get something like "10 days" or "00:10".
>
> Can i get the number of seconds elapsed between the two timestamps.
> Plz help me. I am trying the first time using the stored procedures.


   Use extract(epoch from interval) to get this.  More details can be
found in the Functions and Operators section of the Users Guide.

   Regards,
       Harry.