怎么把表的第i行和第i+1行连接?
如题
------解决方案--------------------做一个存储过程,把下面选出来的记录做一次编辑,我觉得比较好。
select * from (
select rownum id ,* from table
) where id =i or id = i+1
用同样的结果的两次联接,也可以。
select a.*,b.*
from
(select * from (
select rownum id ,* from table
) where id =i) a,
(select * from (
select rownum id ,* from table
) where id =i + 1) b