需要修复合并更新查询(简单但仍然令人困惑)
MERGE INTO table_1 a
USING
(SELECT * from table_2) b ON ( a.row_id = b.row_id and a.in_correct IS NULL)
WHEN MATCHED THEN UPDATE SET a.in_correct = 'Y';
在上面的查询中 ORA-38104: ON 子句中引用的列无法更新。
我已经坐了几个小时来解决这个问题。
我已经确定问题出在 in_ Correct 字段上。
该字段“in_ Correct”不能同时放置在 ON 子句中和 SET 之后。但为了满足我的标准,我别无选择。
请帮帮我
MERGE INTO table_1 a
USING
(SELECT * from table_2) b ON ( a.row_id = b.row_id and a.in_correct IS NULL)
WHEN MATCHED THEN UPDATE SET a.in_correct = 'Y';
In the above query ORA-38104:Column referenced in ON clause cannot be updated.
I have been sitting for hours to resolve this.
I have identified that the problem is the field in_correct.
This field "in_correct" cannot be put in both ON clause and also after SET. But in order satisfy my criteria,I have no option.
Please help me out
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新:
一个更“通用”的命令(对于非空值):
UPDATE:
A more "general" command (for non null values):