Merge oracles in update where c #

Oracle SQL update based on subquery between two tables

I am currently writing update statements to keep a query table can constantly up to date. The schema is identical between the two tables and the contents are not important:

My update statement looks like this:

Two things to note is that 1) there is no where clause at the end of my update (this may be the problem) and 2) all records have the same values ​​after being updated. What I mean by that is this:

My question is how can I fix this so that the table correctly reflects "new" data from staging as a correct SQL update?


So my staging data might happen to mirror what's in and because of the discussion it will:

UPDATE the second

The query I would like to run is this:

However, this results in invalid identifier problems on "the"

  • Do you want Surname and counting in PRODUCTION - Table up-to-date and STAGING Change table?
  • Why don't you use the triggers to insert new values ​​instead of this update? what exactly does this update do?
  • Agreed, when synchronizing tables, triggers can be really useful in keeping you up to date in real time. Just watch out for the mutating table errors, and be sure to do it as AFTER the INSERT OR UPDATE.
  • This update is only to pull data from staging in order to keep the production up to date. Similar to weather reports there are for a real-life example. Every X minutes or so
  • This will most likely become a trigger that I'm trying out the plain sql by myself.