那还是用我的吧,呵呵
with
new_tab as (
select rid,value
from (
select rownum rid,value
from tab_a
)
)
select value,(nvl(b.value,a.value)-a.value) dif_value
from new_tab a,new_tab b
where a.rid=b.rid(+)-1
with
tab as (
select rid,value
from (
select rownum rid,value
from tab_a
)
)
select value,(nvl(b.value,a.value)-a.value) dif_value
from tab a,tab b
where a.rid=b.rid(+)-1