一句:
select name,count(type) as All,sum(case when type =0 then 1 else 0 end) as Zero
from tablename
group by Name
select name,count(type) as All,sum(case when type =0 then 1 else 0 end) as Zero
from tablename
group by Name
调试欢乐多
from tablename
group by Name