日期:2014-05-18 浏览次数:20719 次
select isnull(t.AreaNAME , '总计') 代维公司,
sum(case m.GzNAME when '网路故障' then 1 else 0 end) 网路故障,
sum(case m.GzNAME when '打印机故障' then 1 else 0 end) 打印机故障,
sum(case m.GzNAME when '复印机故障' then 1 else 0 end) 复印机故障,
sum(case m.GzNAME when '传真机故障' then 1 else 0 end) 传真机故障,
count(1) 总计
from Areainfo t , typeinfo m , signinfo n
where t.AreaID = n.GzArea and n.GzType = m.GzID
group by t.AreaNAME with rollup