I am using the below query,
MERGE INTO table2 b
USING (
SELECT column1,column2,column3
FROM table1
) a
ON (a.column3 = 'UPDATE')
WHEN NOT MATCHED THEN
INSERT (b.column1, b.column2) VALUES (a.column1,a.column2)
WHEN MATCHED THEN
UPDATE SET a.column1 = b.column1,a.column2=b.column2;
When the table2 is empty it is running succesfully for the first time.
If i am running for the second time even though table1 data isn't changed i am getting the error as unable to get a stable set of rows in the source tables
..Is there a workaround for this error.
As mentioned in this thread , I tried putting the Distinct
but it did not solve..
I think rowid
should solve the purpose here..but not sure
Thanks