现在的位置: 首页 > 综合 > 正文

上一条记录下一条记录

2013年10月21日 ⁄ 综合 ⁄ 共 311字 ⁄ 字号 评论关闭

select top 1 * from 表 where id>当前id order by id desc
select top 1 * from 表 where id<当前id order by id desc

 

//上一条记录

select top 1 blogId from GCC_blogInfo 
where [blogId] < @blogId and [userId] = @userId and isSketch = 2 order by creatTime desc

 

//下一条记录

select top 1 blogId from GCC_blogInfo 
where [blogId] > @blogId and [userId] = @userId and isSketch = 2 order by creatTime desc

抱歉!评论已关闭.