扫码关注官方订阅号
id: 3,2,5,10,4 select * from id in (3,2,5,10,4);
但是顺序会乱。sql中有没有自带的处理函数?
------------------补充------------------------------
想利用mysql中limit做分页,所以想在mysql中原生解决。
闭关修行中......
SELECT * FROM user_info_tbl where id in (150633922,150986697,7000084,7000083) order by find_in_set(id,'150633922,150986697,7000084,7000083');
user_info_tbl
select *from table where id in (3,2,5,10,4) order by FIND_IN_SET(id,'3,2,5,10,4');
Select Id From Uid Where Id!='' Order By FleId(Id,2,3,1);
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
SELECT * FROM
user_info_tblwhere id in (150633922,150986697,7000084,7000083) order by find_in_set(id,'150633922,150986697,7000084,7000083');select *from table where id in (3,2,5,10,4) order by FIND_IN_SET(id,'3,2,5,10,4');Select Id From Uid Where Id!='' Order By FleId(Id,2,3,1);