select
sum(case when 列2='苹果' then 1 else 0 end) 苹果,
sum(case when 列2='梨' then 1 else 0 end) 梨,
count(*) from 表一 group by 列1
sum(case when 列2='苹果' then 1 else 0 end) 苹果,
sum(case when 列2='梨' then 1 else 0 end) 梨,
count(*) from 表一 group by 列1
调试欢乐多
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货