数据表t的ddl:
create table t(class char(1),callcount int,calldate date)


sql语句:

select calldate,

sum(case class when '1' then callcount else 0 end) as A,

sum(case class when '2' then callcount else 0 end) as B,

sum(case class when '3' then callcount else 0 end) as C

from t group by calldate

最后结果: