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

Home -> Community -> Usenet -> c.d.o.server -> a sql question

a sql question

From: <zlmei_at_hotmail.com>
Date: 5 Mar 2007 14:36:03 -0800
Message-ID: <1173134163.420944.106240@h3g2000cwc.googlegroups.com>


Hi,

Oracle 10g.
I have a table with data like this:

id val
1 100
2 101
3 200
4 300

and I want a query which displays the result of "val" minus the "previous val", order by id, something like:

id computed_value

2       1
3       99
4       100

How do I accomplish that using sql (not pl/sql)?

TIA
Guang Received on Mon Mar 05 2007 - 16:36:03 CST

Original text of this message

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