I'm using a merge statement to merge two tables where one row in the source table may update multiple rows in the target table.
It goes a bit like this
MERGE TABLE1 A
USING (SELECT EMP_CODE, DAYS_OFF FROM TABLE2) B
ON (A.ID = B.EMP_CODE)
WHEN MATCHED THEN
UPDATE SET A.DAYS_OFF = B.DAYS_OFF;
However, when i attempt this, i get SQL Error: ORA-30926: unable to get a stable set of rows in the source tables
Is there any other way i can do this?
Because, your source table probably contains duplicate values.
You probably need to add one more column to uniquely identify each row.
Now we are going to merge two table.
Solution
Read more