oracle数据库求差值的sql语句

更新时间:01-23 教程 由 孤魂 分享

oracle数据库求差值的sql语句?

with t1 as (select shuzi,riqi,rownum as rnfrom (select shuzi,riqifrom Aorder by 2) t)select p.shuzi-nvl(m.shuzi,0) as new_shuzi,p.riqifrom t1 pleft join t1 m on p.rn-1=m.rn;你看下这个结果

声明:关于《oracle数据库求差值的sql语句》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2295522.html