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

 

相关文章:

  • 2022-12-23
  • 2021-07-20
  • 2022-03-11
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-01-20
  • 2021-10-03
相关资源
相似解决方案