座席工号 | 录音编号 | 来电号码 | 评价结果 |
0001 | qww11 | 88888888 | 29 |
满意度调查统计 | ||||||
座席工号 | 很是满意 | 满意 | 通常 | 不满意 | 总计 | 满意度 |
0001 | 86 | 69 | 14 | 11 | 180 | 93.88% |
0002 | 93 | 30 | 6 | 10 | 139 | 92.80% |
用sql语句来统计出来一张满意度调查统计表: sql
select t.agent_id,
sum(case
when t.grade_id = 1070771 then
1
else
0
end) as Vsatisfied,
sum(case
when t.grade_id = 1070772 then
1
else
0
end) as Satisfied,
sum(case
when t.grade_id = 1070773 then
1
else
0
end) as General,
sum(case
when t.grade_id = 1070774 then
1
else
0
end) as Yawp,
count(*) as scount,
(sum(case
when t.grade_id = 1070771 then
1
else
0
end) + sum(case
when t.grade_id = 1070772 then
1
else
0
end) + sum(case
when t.grade_id = 1070773 then
1
else
0
end)) / count(*)*100 ||'%' as satisficing
from tablename t
group by t.agent_id
spa