¡¡¡¡
MySQLÖиù¾ÝID²éѯָ¶¨¼Ç¼(idΪ26)µÄÉÏÒ»Ìõ¼Ç¼ºÍÏÂÒ»Ìõ¼Ç¼:
ÉÏÒ»Ìõ SELECT * FROM xxx WHERE id < 26 ORDER BY id DESC LIMIT 1;
ÏÂÒ»Ìõ SELECT * FROM xxx WHERE id > 26 ORDER BY id LIMIT 1;
»òÕßÊÔÊÔ£º
ÉÏÒ»Ìõ
select * from xxx where id =
(select max(id) from xxxx where id < 26 order by px_id desc, id desc);
ÏÂÒ»Ìõ
select * from content where id =
(select min(id) from xxxx where id > 26 order by px_id desc, id desc);