在Oracle上使用内部联接更新语句我有一个在MySQL中工作正常的查询,但是当我在Oracle上运行时,我收到以下错误:SQL错误:ORA-00933:SQL命令未正确结束00933. 00000 - “SQL命令未正确结束”查询是:UPDATE table1INNER JOIN table2 ON table1.value = table2.DESCSET table1.value = table2.CODEWHERE table1.UPDATETYPE='blah';
4 回答
侃侃无极
TA贡献2051条经验 获得超10个赞
用这个:
MERGE
INTO table1 trg
USING (
SELECT t1.rowid AS rid, t2.code
FROM table1 t1
JOIN table2 t2
ON table1.value = table2.DESC
WHERE table1.UPDATETYPE='blah'
) src
ON (trg.rowid = src.rid)
WHEN MATCHED THEN UPDATE
SET trg.value = code;
白衣染霜花
TA贡献1796条经验 获得超10个赞
UPDATE ( SELECT t1.value, t2.CODE
FROM table1 t1
INNER JOIN table2 t2 ON t1.Value = t2.DESC
WHERE t1.UPDATETYPE='blah')
SET t1.Value= t2.CODE
添加回答
举报
0/150
提交
取消