当前位置:Gxlcms > 数据库问题 > Oracle查询当前记录的上一条记录或下一条记录

Oracle查询当前记录的上一条记录或下一条记录

时间:2021-07-01 10:21:17 帮助过:167人阅读

//查询当前记录的

//oracle 上一条记录
select decode(decode(txbs,‘无‘,null,txbs),lag(t.txbs, 1, 0) over(order by t.cjid),‘是‘,‘否‘)from qb_app_rycj t 

 //下一条记录
select t.id, lead(t.id, 1, 0) over(order by t.sort,t.eidt_date) as p from cms_article t

Oracle查询当前记录的上一条记录或下一条记录

标签:sort   ora   rac   rom   null   .so   lag   bsp   date   

人气教程排行