SELECT * FROM (SELECT * FROM 表 WHERE id<居中的ID ORDER BY id DESC LIMIT 5) as A
UNION all
SELECT * FROM (SELECT * FROM 表 WHERE id >=居中的ID ORDER BY id ASC LIMIT 5) as B
order by id asc
转载于:https://www.cnblogs.com/mali0932/p/3731998.html