Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Calculate timedifferences within one database column
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