How to subtract current value from next value(row) of the same column
515430Apr 13 2009 — edited Apr 14 2009Hi,
I am struggling to write an SQL query which can do some thing like as shown in the example.
Suppose I have a value column with values like
VALUE
---------------
21138672941
21266223360
21375446692
21464626060
21546520653
21616643777
21689565041
21781762699
21882541342
21983644803
22086697638
My requirement is to write a query to subract 1st row from second, second from third, third from fourth and so on.
The ouput should be 127550419, 109223332 and so on.
Is it possible with a query? Please provide me the query of pl/sql code if this is possible.
Regards
Satish