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

Home -> Community -> Usenet -> c.d.o.tools -> Calculate timedifferences within one database column

Calculate timedifferences within one database column

From: Burkhard Kiesel <burkhard.kiesel_at_med.siemens.de>
Date: Mon, 30 Jul 2001 14:40:10 +0200
Message-ID: <3B6555A9.1EA44B6C@med.siemens.de>

Hi,

I have a table with a datetime column, with the following data, e.g.:

2001-07-27 08:37:00
2001-07-27 08:42:28
2001-07-27 08:43:38
2001-07-27 08:44:14
2001-07-27 08:47:31

What I need is retrieving the information with a sql query which give the timedifference for every pair.
If there is a last line (no corresponding end-time), the calculation should be SYSDATE - 2001-07-27 08:47:31
E.g.: 2001-07-27 08:42:28 - 2001-07-27 08:37:00

         2001-07-27 08:44:14 - 2001-07-27 08:43:38
         SYSDATE - 2001-07-27 08:47:31

How can I solve this ?

Regards

Burkhard Kiesel Received on Mon Jul 30 2001 - 07:40:10 CDT

Original text of this message

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