已经解决了,写法上出了一点问题

解决方案 »

  1.   

    语法没有啥问题,分组聚合查询,主要检查下字段的取值是否正确。
      

  2.   

    count(case when A.RDMemos ='高流量' and A.RDLong >15 then 0  else 0 end) as 高流量次数,
      count(case when A.RDMemos='低流量' and A.RDLong >15 then 0 else 0 end) as 低流量次数,
      count(case when A.RDMemos='空流量' and A.RDLong >15 then 0 else 0 end) as 空流量次数, 
    将其中的count改成sum 即可