我有兩個不同的表:Table_a和Table_b,都有相同的列PartNo和Material_Desc。當PartNo爲等於時,我希望Table_b中的Material_Desc更新Table_a中的Material_Desc。這是我的查詢SQL ORACLE ORA-00969:缺少關鍵字?
MERGE INTO Table_b
USING (SELECT t1.rowid AS rid
, t2.Material_Desc
FROM Table_b t1
JOIN Table_a t2
ON Table_b.PartNo = Table_a.PartNo)
ON rowid = rid
WHEN MATCHED THEN
UPDATE
SET Table_a.Material_Desc = Table_b.Material_Desc;
我知道Oracle不支持更新語句的連接,所以我嘗試了上面的查詢。它仍然給我ORACLE ORA-00969:缺少ON關鍵字錯誤
見我對這個答案的評論:http://stackoverflow.com/a/2446859/244826後 – Sonny
條件的''ON **必須**在括號中:'ON(rowid = rid)' –