ORACLE数据库,MERGE INTO语句,经常会出现 ORA-30926: unable to get a stable set of rows in the source tables 这个错误,如下图所示:
经检查,这个错误是由于数据来源表(即语句中,from关键字后面的表)存在数据重复造成的。在实际项目研发中,我们一般不能随便改动数据表的记录,那么如何避免这种错误的产生以及如何改正错误呢?
请看下面的SQL:
MERGE INTO TEMP_ZL_ACCOUNTLIST t1 USING (select * from (select row_number() over(partition by a.SCREEN_NAME order by a.user_id desc) rd, a.*, a.rowid row_id from pprt.T_BP_ACL_USER a) where rd = 1) t2 ON ( t1.LOGIN_NO = t2.SCREEN_NAME ) WHEN MATCHED THEN UPDATE SET t1.user_id = t2.user_id;
ORACLE MERGE INTO语句,unable to get a stable set of rows in the source tables报错解决,布布扣,bubuko.com
ORACLE MERGE INTO语句,unable to get a stable set of rows in the source tables报错解决
原文地址:http://blog.csdn.net/zhanglu0223/article/details/28428573