您的位置:首页 > 数据库 > MySQL

mysql 函数 find in set()

2016-04-11 15:56 661 查看
字符串中查找不用in 用find in set()

语句的排序问题:

select id from test_select_in where id in(id) order by field(id);

select id,number from test_select_in where number in(id)
order by field(number,id);

select id from test_select_in where id in(id)
order by find_in_set(id,'id');

存在效率问题,特别是数据量较大的时候。所以最好还是直接返回结果然后在应用程序里重新排序。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: