order by case when then end是按条件来排序,举个简单的例子:select   a,b,c   from   tab   order   by   case   表达式   when   条件1   then   a   when   条件2   then   b   else   c   end;     
order by case when then end这个select语句就是当表达式满足条件1的时候就按a来排序,满足条件2的时候就按b排序,否则就按c排序

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-02-15
相关资源
相似解决方案