select t.*, t.rowid from table1 t;
select t.*, t.rowid from table1 t
where t.rowid>(select rowid from table1 where id='1')
and rownum=1;--id='1'的后一条记录
select * from (select t.*,rownum num from table1 t
where t.rowid<(select rowid from table1 where id='1')
) t1 where
num=(select count(*) from table1 t
where t.rowid<(select rowid from table1 where id='1'));--id='1'的前一条记录
查询某一条记录的前一条记录和后一条记录
最新推荐文章于 2023-01-19 17:39:07 发布