直接写就行了么,select 字段A-字段B from 表名
select b.字段-a.字段 from (select row_number() over (order by id) as row_id,* from 表名)a,(select row_number() over (order by id) as row_id,* from 表名)bwhere a.row_id+1=b.row_id