Felipe09
(usa Outra)
Enviado em 01/02/2019 - 16:25h
Boa tarde pessoal.
Não estou conseguindo identificar onde estou definindo uma coluna de maneira ambígua alguém pode ajudar?
SELECT EDR.call_date,MTR.CALL_TYPE_ID,OPE.OPERATOR, MDL.MODULE_ID,
NVL(SUM(ENT),0) AS ENT,
NVL(SUM(DSD),0) AS DSD,
NVL(SUM(DSC),0) AS DSC,
NVL(SUM(DUP),0) AS DUP,
NVL(SUM(REJ),0) AS REJ,
NVL(SUM(REC),0) AS REC,
NVL(SUM(SAI),0) AS SAI
FROM
(
SELECT *
FROM RD_T_EDR_DETAILED_SCTR EDR, RD_R_METRICS MTR, RD_R_OPERATOR OPE, RD_R_MODULE MDL
WHERE MTR.ACCOUNTING_TYPE = 'QTD'
AND MTR.SYSTEM = 'SCTR'
AND MTR.METRIC_ID = EDR.Metrica
AND MTR.ENABLED = '1'
AND MTR.MODULE_ID in ('H41','H42','H43')
AND EDR.call_date = TO_DATE('25/01/19','DD/MM-YY')
AND MTR.CALL_TYPE_ID = '2'
)
PIVOT (SUM(EDR.VALOR) -- Fun¿ Pivot: transforma registros em colunas
FOR CONTROL_POINT_ID IN ('ENT' AS ENT, 'SAI' AS SAI, 'REJ' AS REJ, 'DSC' AS DSC, 'REC' AS REC, 'DSD' AS DSD, 'DUP' AS DUP))
GROUP BY EDR.call_date,MTR.CALL_TYPE_ID,OPE.OPERATOR,MTR.CALL_TYPE_ID,MDL.MODULE_ID;
ORA-00918: coluna definida de maneira ambígua