G073" AS KOLICHESTVO_DOSMOTROV,
"Sum - Sum - RESULT"
AS DOSMOTROV_S_RESULTATOM,
ROUND(DOLYA,2) AS DOLYA,
to_number (ROUND((DOLYA_KAT*((RESULT1 + RESULT2 + RESULT3 + RESULT4 + 6)/10)),2)) AS DOLYA_KAT,
"Sum - N_kat1" AS NKAT_1,
"Sum - N_kat2" AS NKAT_2,
"Sum - N_kat3" AS NKAT_3,
"Sum - N_kat4" AS NKAT_4,
CASE WHEN "Sum - Count - G073" = 0 THEN 'НЕ ОЦЕН.'
when "Sum - Sum - RESULT" =0 AND ROUND("Sum - Count - G073",2)>0 THEN 'НЕУД'
WHEN ROUND(DOLYA_KAT,2) >= 3 and KPED = 10 THEN 'ХОР'
WHEN (ROUND((DOLYA_KAT*((RESULT1 + RESULT2 + RESULT3 + RESULT4 + 6)/10)),2)/3)>=0.75 and KPED = '10' THEN 'УД'
FROM
(SELECT
T.KPED,
T.NAIMT,
Sum(K."Count - G073") AS "Sum - Count - G073",
Sum(K."Sum - RESULT") AS "Sum - Sum - RESULT",
CASE WHEN Sum(K."Count - G073")>0 THEN (Sum(K."Sum - RESULT") / Sum(K."Count - G073"))*100 ELSE NULL END AS DOLYA,
CASE WHEN Sum(K."Count - G073")>0 THEN (Sum(K."Sum - RESULT") / Sum(K."Count - G073"))*100 ELSE NULL END AS
DOLYA_KAT,
Sum(K.N_kat1) AS "Sum - N_kat1",
Sum(K.N_kat2) AS "Sum - N_kat2",
Sum(K.N_kat3) AS "Sum - N_kat3",
Sum(K.N_kat4) AS "Sum - N_kat4",
case when Sum(K."Sum - RESULT")>0 then ROUND((( Sum(K.N_kat1) / Sum(K."Sum - RESULT"))*100),2) else 0 END AS KKAT_1,
case when Sum(K."Sum - RESULT")>0 then ROUND((( Sum(K.N_kat2) / Sum(K."Sum - RESULT"))*100),2) else 0 END AS KKAT_2,
case when Sum(K."Sum - RESULT")>0 then ROUND((( Sum(K.N_kat3) / Sum(K."Sum - RESULT"))*100),2)else 0 END AS KKAT_3,
case when Sum(K."Sum - RESULT")>0 then ROUND((( Sum(K.N_kat4) / Sum(K."Sum - RESULT"))*100),2) else 0 END AS KKAT_4,
GROUP BY T.KPED, T.NAIMT,
Z.znachenie1,
Z.znachenie2,
Z.znachenie3,
Z.znachenie4 )
15