Skip to content
Advertisement

How to update table with data from another table

I have two tables

First table INTRA.TABLE_A

Second table EXTRA.TABLE_B

And I am trying to get data from INTRA.TABLE_A into EXTRA.TABLE_B with update:

But it “throws” syntax error at FROM word:

syntax_error

After update, result should looks like:

I am using sqlDeveloper and Oracle database. How can I fix it?

Advertisement

Answer

Oracle does not support joins in update queries – unlike other database, such as SQL Server (in which the query you are using would probably run just as it is).

I would recommend a correlated subquery:

You might want to add a condition to ensure that only “matching” rows are updated:

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