ORA-30926: unable to get a stable set of rows in the source tables(ORA-30926: 无法在源表中获得一组稳定的行)
问题描述
我得到了
ORA-30926: 无法在源表中获得一组稳定的行
ORA-30926: unable to get a stable set of rows in the source tables
在以下查询中:
MERGE INTO table_1 a
USING
(SELECT a.ROWID row_id, 'Y'
FROM table_1 a ,table_2 b ,table_3 c
WHERE a.mbr = c.mbr
AND b.head = c.head
AND b.type_of_action <> '6') src
ON ( a.ROWID = src.row_id )
WHEN MATCHED THEN UPDATE SET in_correct = 'Y';
我运行了 table_1 它有数据,我也运行了内部查询 (src),它也有数据.
I've ran table_1 it has data and also I've ran the inside query (src) which also has data.
为什么会出现这个错误,如何解决?
Why would this error come and how can it be resolved?
推荐答案
这通常是由 USING 子句中指定的查询中的重复项引起的.这可能意味着 TABLE_A 是父表,并且多次返回相同的 ROWID.
This is usually caused by duplicates in the query specified in USING clause. This probably means that TABLE_A is a parent table and the same ROWID is returned several times.
您可以通过在查询中使用 DISTINCT 来快速解决问题(实际上,如果Y"是一个常量值,您甚至不需要将其放入查询中).
You could quickly solve the problem by using a DISTINCT in your query (in fact, if 'Y' is a constant value you don't even need to put it in the query).
假设您的查询是正确的(不知道您的表),您可以执行以下操作:
Assuming your query is correct (don't know your tables) you could do something like this:
MERGE INTO table_1 a
USING
(SELECT distinct ta.ROWID row_id
FROM table_1 a ,table_2 b ,table_3 c
WHERE a.mbr = c.mbr
AND b.head = c.head
AND b.type_of_action <> '6') src
ON ( a.ROWID = src.row_id )
WHEN MATCHED THEN UPDATE SET in_correct = 'Y';
这篇关于ORA-30926: 无法在源表中获得一组稳定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ORA-30926: 无法在源表中获得一组稳定的行
基础教程推荐
- 在多列上分布任意行 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
