Oracle sql与三重where子句合并到
我有以下SQL代码(这是我到目前为止得到的): 但我收到以下错误消息:Oracle sql与三重where子句合并到,sql,oracle,where-clause,sql-merge,Sql,Oracle,Where Clause,Sql Merge,我有以下SQL代码(这是我到目前为止得到的): 但我收到以下错误消息: 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 o
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
错误的原因是什么?在代码中的何处进行更改以使其工作
谢谢你的帮助 合并脚本通常执行许多DML操作,我建议您创建第二个查询的视图,而不是在合并语句中使用筛选子句。并且,在源语句中还有where子句 为源和目标创建视图,使合并作业更容易 “无法在源表中获取一组稳定的行” 之所以出现此错误,是因为子查询从要合并到的表中选择了
SCHEMA\u 1.TABLE\u 1
。我们不能这样做:MERGE-INTO-SCHEMA_1.TABLE_1 table1
语句意味着您正在插入或更新该表。那么Oracle应该在子查询中返回哪个版本的数据呢
您需要在
USING
子句中重写子查询,以便它捕获子查询的逻辑(显然减去SCHEMA\u 1.TABLE\u 1
)。这将为您提供在连接或匹配的过滤器上优化所需的值 尝试一下,描述的一些问题可能与您的问题相匹配。这些问题如何回答OP的问题?可能您不理解这个问题,即“为什么会出现错误?”问题来自using
子句或where table 1.COLUMN_2 in(选择子句?匹配时中的where子句)。(尽管using子句 有一个视图,因此这也可能有问题。)是的,但我需要使用它来获得适当的结果,我还有什么选择?WHERE子查询的点是什么?您在这里发布的内容不会将表_1
连接到任何其他表。可能只是匿名中的一个错误。请您建议将所述子句的内容放在哪里,以免妨碍e执行(例如在USING子句中…)。
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