oracle sql (select a column and subtract it to the column of the next row) - TechRepublic
Question
October 2, 2008 at 07:20 PM
swishkeed

oracle sql (select a column and subtract it to the column of the next row)

by swishkeed . Updated 16 years, 11 months ago

For example, i have this table;
START END
—– —–
06:57:35 07:00:43
07:03:50 07:07:00
07:07:12 07:10:21
07:13:18 07:16:24

how do you get a result to be like this;
START END RESULT
—– —– ——
06:57:35 07:00:43
07:03:50 07:07:00 00:03:07
07:07:12 07:10:21 00:00:12
07:13:18 07:16:24 00:02:57

How do you select the column END from the first row then subtracting it to the column START of the next row. (goes like 07:00:43 – 07:03:50,
that’s why you will notice that the RESULT of the first row is blank)

thank you…

This discussion is locked

All Comments