表searchId为当前id
1.查询上一条数据
select * from tbContent where id=(select max(id) from tbContent where id<searchId)
2.查询下一条数据
select * from tbContent where id=(select min(id) from tbContent where id>searchId)
3.查询上一条和下一条数据
select * from tbContent where
id in((select max(id) from tbContent where id< searchId),
(select min(id) from tbContent where id> searchId))