我已经在这个问题上挣扎了一段时间了,希望能得到一些建议。关于我正在使用的更新/合并查询中涉及的源表和目标表的一些上下文:
SRC Table
Format_Code ACR
----------------------------
BAD 5
SAD 7
MAD 2SRC是通过连接两个表的select语句创建的;select语句如下所示:
Select distinct a.Format_Code, b.ACR from Formats a
Inner join Codes b on lower(a.Format_Name) = lower(b.Format_Name)我正在尝试使用SRC更新目标表(DES),在Format_Code上连接/匹配,如下所示:
Merge Into Inventory DES
Using
(
Select distinct a.Format_Code, b.ACR from Formats a
Inner join Codes b on lower(a.Format_Name) = lower(b.Format_Name)
) SRC
On DES.Format_Code = SRC.Format_Code
When Matched Then Update set DES.ACR = SRC.ACR我得到以下错误(我认为是因为目标表中的重复项),但不确定如何忽略/绕过它们。SRC不包含重复项,但DES具有重复的Format_Code。在更新期间,我希望只更新重复行的一个实例,或者完全忽略重复项(少量重复项,因此如果需要,我可以手动更新)
SQL Error: ORA-30926: unable to get a stable set of rows in the source tables
30926. 00000 - "unable to get a stable set of rows in the source tables"
*Cause: A stable set of rows could not be got because of large dml
activity or a non-deterministic where clause.
*Action: Remove any non-deterministic where clauses and reissue the dml.这是我第一次发帖,如果我犯了新手的错误,很抱歉
发布于 2018-01-27 02:17:02
...因为有大量的dml活动...
尝试COMMIT,然后运行您的MERGE。有什么改进吗?
https://stackoverflow.com/questions/48466347
复制相似问题