第二行数据减第一行数据

原表

select t1.c1-t2.c1 c1,t1.c2-t2.c2 c2 from
( select rownum a,c1,c2 from tt ) t1,
( select rownum a,c1,c2 from tt ) t2
where t1.a=t2.a+1

原文地址:https://www.cnblogs.com/feng666666/p/5955762.html