select che,GROUP_CONCAT(concat_ws(':',routeNo,num)  ORDER BY num DESC SEPARATOR ',') as gg
from 
    (select  che,routeNo,count(distinct paicheNo) as num
    from tableA
    where carrierType=1 and length(deptName)>1 and paicheCreateTime >= date_sub(now(),interval 4 WEEK) and length(che)>5 and  che not like '%汇%'
    group by che,routeNo order by che,num desc) a
group by che
limit 5;

 

相关文章:

  • 2021-05-15
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-29
  • 2018-04-24
猜你喜欢
  • 2020-07-15
  • 2021-11-09
  • 2021-05-24
  • 2022-01-31
  • 2022-12-23
  • 2021-09-11
  • 2021-10-03
相关资源
相似解决方案