MySQL查询in操作 查询结果按in集合顺序显示

上传:bruce49859 浏览: 27 推荐: 0 文件:PDF 大小:52.27KB 上传时间:2021-02-25 20:43:09 版权申诉
MySQL 查询in操作,查询结果按in集合顺序显示 代码如下:select * from test where id in(3,1,5) order by find_in_set(id,’3,1,5′); select * from test where id in(3,1,5) order by substring_index(‘3,1,2’,id,1);偶尔看到的。。。或许有人会注意过,但我以前真不知道 SQL: select * from table where id IN (3,6,9,1,2,5,8,7); 这样的情况取出来后,其实,id还是按1,2,3,4,5,6,7,8,9,
上传资源
用户评论