oracle 查询当前记录的上一条记录或下一条记录
发布时间:2020-12-12 16:21:09 所属栏目:百科 来源:网络整理
导读:上一条 select * from cms_article a where id = (select c.p from (select t.id,lag(t.id,1,0) over(order by t.sort) as p from cms_article t) c where c.id = '8a3e56b6396630260139663fa32d01e1'); 下一条 select a.id,a.title from cms_article a wher
上一条 select * from cms_article awhere id = (select c.p from (select t.id,lag(t.id,1,0) over(order by t.sort) as p from cms_article t) c where c.id = '8a3e56b6396630260139663fa32d01e1'); 下一条 select a.id,a.title from cms_article a where id = (select c.p from (select t.id,lead(t.id,0) over(order by t.sort,t.eidt_date) as p from cms_article t ) c where c.id = '8a3e56b6396630260139663fa32d01e1'); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |