select * from t_zhy_XX where id in (select case when SIGN(id-?1)>0 THEN MIN(id) when SIGN(id-?1)<0 THEN MAX(id) ELSE id end from t_zhy_XX where status =3 and del_flag = 0 and parent_id = 2 GROUP BY SIGN(id-?1)) ORDER BY create_date
Mysql 查询满足条件 相邻的两条数据(场景:上一篇、下一篇)
最新推荐文章于 2024-06-06 16:15:18 发布