Skip to content
Advertisement

Update column in Oracle table with value from another table with duplicates

I am trying to update the column (REPT_IND) from table A to the value in table B where A.ID = B.ID and some conditions in table B. There are some duplicates in table B, but nonetheless the REPT_IND is the same and I still need the value. How can I do this on Oracle? Any tips are appreciated thank you!

The Following code has the Error:

Code:

Advertisement

Answer

You can try also merge statement:

Or if you do not want to set a.rept_ind to null if there is no relevant rows in b:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement