日期:2014-05-17 浏览次数:20468 次
select sum(case 很好 when 1 then 1 else 0 end) as sum_很好,
sum(case 较好 when 1 then 1 else 0 end) as sum_较好,
sum(case 一般 when 1 then 1 else 0 end) as sum_一般,
sum(case 接车 when 1 then 1 else 0 end) as sum_接车,
sum(case 机电 when 1 then 1 else 0 end) as sum_机电,
sum(case 钣金 when 1 then 1 else 0 end) as sum_钣金,
sum(case 美容 when 1 then 1 else 0 end) as sum_美容,
sum(case 销售 when 1 then 1 else 0 end) as sum_销售 from table
SELECT 'sum_很好',sum(case 很好 when 1 then 1 else 0 end) FROM table
UNION ALL
SELECT 'sum_较好',sum(case 较好 when 1 then 1 else 0 end) FROM table
SELECT 'sum_很好' 评价类型 ,
SUM(CASE 很好
WHEN 1 THEN 1
ELSE 0
END) 得分
FROM [table]
UNION ALL
SELECT 'sum_较好' 评价类型 ,
SUM(CASE 较好
WHEN 1 THEN 1