sql in查询排序

1.默认下,使用select xxx where in(xx,xx)查询,返回结果是按主键排序的,如果要按in()中值的排列顺序,可以这样做:
 
select * from talbe where id in(3,2,4,1) ORDER BY FIND_IN_SET( id, '3,2,4,1') 
本文转自http://blog.chinaunix.net/uid-20304312-id-1707798.html 感谢作者
原文地址:https://www.cnblogs.com/panxuejun/p/6188429.html