--上一条
select top 1 * from table_name where id < 8 order by id desc
--下一条
select top 1 * from table_name where id > 8 order by id asc
--8为你当前记录的ID
select max(id) from where id<8 --上一条
select min(id) from where id>8 --下一条
--上一条
select top 1 * from table_name where id < 8 order by id desc
--下一条
select top 1 * from table_name where id > 8 order by id asc
--8为你当前记录的ID
select max(id) from where id<8 --上一条
select min(id) from where id>8 --下一条