你能幫我解決合併查詢的錯誤嗎? 查詢:oracle合併查詢問題
MERGE INTO TEST_STATUS_REV TB1
USING
(
SELECT
TB2.ITG,'1',TB2.CORP_LOAD_ID,TB2.LVL_CYC,'',TB2.BUS_FUNC,'',COUNT(TB2.status) AS Passed,'','','','',TB2.IMPT_ENG,TB2.VAL_TYP,'',''
FROM [email protected]_PROD TB2
where TB2.status like 'Pass%'
and TB2.lvl_cyc='L3C1'
GROUP BY
TB2.ITG,
-- TB2.RTS,
TB2.CORP_LOAD_ID,
TB2.LVL_CYC,
-- CONF,
TB2.BUS_FUNC ,
-- TB2.TC_PLN,
-- TB2.TC_PASSED,
-- TB2.TC_FAILED,
-- TB2.NAV,
-- TB2.PND
-- TB2.COM,
TB2.IMPT_ENG,
TB2.VAL_TYP
-- TB2.TC_TOT
-- TB2.FEAT_ID
) SRC
ON
(
TB1.LVL_CYC = SRC.LVL_CYC
)
WHEN MATCHED THEN UPDATE SET TB1.TC_PASSED = SRC.STATUS;
錯誤:
Error report:
SQL Error: ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
我試圖修復它許多可能的方法,但仍是問題仍然存在。
嘗試對TB2.ITG後的'1'進行註釋,並嘗試清除您的查詢,大量評論它很混亂 – Thomas