0
這將返回2條記錄,但第二行總和顯示爲空,出了什麼問題?GROUP BY顯示總計錯誤結果
SELECT nvl(X_CDTR_AGT_ID_2AND,' ')
,COUNT(CASE P_PMNT_SRC WHEN 'FDR_ATM' THEN 1 END) as atmCount
,(SELECT sum(X_STTLM_AMT) AS IVRSUM
FROM v_minf_report b
WHERE b.X_CDTR_AGT_ID_2AND = ass.X_CDTR_AGT_ID_2AND
GROUP BY X_CDTR_AGT_ID_2AND) as nyun
,COUNT(CASE P_PMNT_SRC WHEN 'FDR_INB' THEN 1 END) as inbCount
,COUNT(CASE P_PMNT_SRC WHEN 'FDR_IVR' THEN 1 END) as ivrCount
,COUNT(CASE P_PMNT_SRC WHEN 'FDR_BV' THEN 1 END) as bvcount
,COUNT(CASE P_PMNT_SRC WHEN 'FDR_MANUAL' THEN 1 END) as manualcount
FROM v_minf_report ass
WHERE P_TX_CTGY = 'CTO'
GROUP BY X_CDTR_AGT_ID_2AND
應該P_TX_CTGY = 'CTO' 在內部選擇申請? –