如果有主键自增或者按时间排序的数据库记录的话直接根据当前的记录的主键或时间,大概可以这样写(select * from table where id > 当前id order by id asc limit 1 ) union (select * from table where id < 当前id order by id desc limit 1)这样差不多能满足