合并声明显示错误:
MERGE INTO costing.table1 USING
(SELECT table1.ROWID row_id,
M.STRPS_MATERIAL AS STRPS_MATERIAL
FROM costing.table2 p
JOIN costing.table1 M
ON p.MATNR = M.MATNR
AND p.WERKS = M.WERKS
AND p.BESKZ = M.BESKZ
AND p.SOBSL = M.SOBSL
WHERE M.SOBSL = '30') src ON (table1.ROWID = src.row_id )
WHEN MATCHED THEN
UPDATE SET M.STRPS_MATERIAL = src.STRPS_MATERIAL;
SQL Error: ORA-00904: "table1"."ROWID": invalid identifier
00904. 00000 - "%s: invalid identifier"
帮助我更正查询,因为rowid
不是table1
中的列。
答案 0 :(得分:0)
您可以尝试以下操作。
MERGE INTO costing.table1 USING
(SELECT M.ROWID row_id,
M.STRPS_MATERIAL AS STRPS_MATERIAL
FROM costing.table2 p
JOIN costing.table1 M
ON p.MATNR = M.MATNR
AND p.WERKS = M.WERKS
AND p.BESKZ = M.BESKZ
AND p.SOBSL = M.SOBSL
WHERE M.SOBSL = '30'
) src ON (costing.table1.ROWID = src.row_id )
WHEN MATCHED THEN
UPDATE SET M.STRPS_MATERIAL = src.STRPS_MATERIAL;