Question Locked

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

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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...

3 replies

by simbex

did u manage to get an answer for the same scenario u had back then?? Really need to solve the same problem: subtracting value from one row from the next row

This discussion is closed to new replies.