座席工號 | 錄音編號 | 來電號碼 | 評價結果 |
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