表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))