Skip to content
Advertisement

Update column values with result from group values (MIN) of linked table

I have two tables Table 1 (main) and Table 2,connected with T1.

I need to delete double entries in Table 1. TO do that before any delete in T1 I must delete or update the data in T2.

The option chosen is to update T2 data to point with entries not to be deleted in T1.

SQL Problem :

I have the following group by expresion :

I want to do something like that avoiding PL/SQL if it’s possible.

But obviously the minid in the set statement is not visible.

Advertisement

Answer

You can prepare the required values in a query with saved rowid from rs2qtt2 and then use it as source data for merge query like

This should help to avoid ORA-38104 and should access rows for merging directly by rowid

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