mysql 按照指定字段的指定数据进行排序 filed函数

filed函数

filed(coulmn,str1,str2,str3…)

tableA中有某一列columA,该列的值包含(0,1,2,3,4,5) 
当前的需求为查询结果不包含3和5,且按2,1,0,4的规则进行排序 
mysql的实现方式:

select * from A where columA in(‘2’, ‘1’, ‘0’) 
order by FIELD(columA ,’2’,’1’, ‘0’) asc
原文地址:https://www.cnblogs.com/shisanye/p/15043392.html