我有以下 SQL 语句:
SELECT TRUNC(TIDSPUNKT) AS PERIOD,
QUEUE,
ROUND(SUM(CASE WHEN BESVARET_25_SEK > 0 THEN BESVARET_25_SEK END ) / SUM(CASE WHEN ANTAL_KALD > 0 THEN ANTAL_KALD END) * 100) AS SVAR_PROCENT
FROM KS_DRIFT.PERO_NKM_KØ_OVERSIGT
WHERE TIDSPUNKT >= '2013-06-17'
AND TIDSPUNKT <= '2013-07-02'
AND ANTAL_KALD > 0
AND QUEUE not in ('TekniskHotline')
GROUP BY TRUNC(TIDSPUNKT), QUEUE
ORDER BY PERIOD
这给了我以下结果:
如您所见,我已经突出显示了两行。在上面的 SQL 语句中,我现在计算两行以获得一个百分比,这是棘手的部分,我的问题不是在一行上有“Erhverv”和“ErhvervOverflow”,而是我想将它们算作一个!
有没有办法做到这一点?