MySQL 查询文章的上下篇
如图,如果查询ID39的上一条信息和下一条信息
解决方案:
SELECT w_id, w_web_name FROM w_web WHERE w_id<39 ORDER BY w_id DESC LIMIT 0, 1; SELECT w_id, w_web_name FROM w_web WHERE w_id>39 ORDER BY w_id ASC LIMIT 0, 1;
效果图:
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11