Error reporting of oracle data merge into solves ORA-30926

ORA-30926: unable to get a stable set of rows in the source tables

1. After inspection, this error is caused by data duplication in the data source table (that is, the table after the from keyword after using in the statement). In actual project development, we generally cannot change the records of the data table casually, so how to avoid such errors and how to correct them?

1. Remove the duplicate data distinct from the table after from

2. Use the row_number() function to sort the duplicate records, and then the subquery only takes the row with rd=1. Such a subquery generates only one record. If you execute the statement again, you will have peace of mind, and you will no longer be afraid of the data source table. Duplicate data error message.

(select * from(select row_number() over(partition by relation_person_name order by CRM_CUST_NO)rd,i.*,i.rowid row_id from MDZ_RELATION_PERSON_INFO i)where rd=1) 

2. It is also possible that the original table data has spaces in a certain field data.

trim removes spaces.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325723816&siteId=291194637