searchNum:為當前查詢的編號
1.查詢上一條數據
select * from tbl_stu where num = (select max(num) from tbl_stu where num < searchNum)
2.查詢下一條數據
select * from tbl_stu where num = (select min(num) from tbl_stu where num > searchNum)
3.查詢上一條和下一條數據
select * from tbl_stu
where num in(
(select max(num) from tbl_stu where num < searchNum),
(select min(num) from tbl_stu where num > searchNum)
)