Updating a table with rows from another table
You can update an entire row in one table with values from a row in another table.
Suppose that a master class schedule table needs to be updated with changes that have been made in a copy of the table. The changes are made to the work copy and merged into the master table every night. The two tables have exactly the same columns and one column, CLASS_CODE, is a unique key column.
UPDATE CL_SCHED SET ROW = (SELECT * FROM MYCOPY WHERE CL_SCHED.CLASS_CODE = MYCOPY.CLASS_CODE)This update will update all of the rows in CL_SCHED with the values from MYCOPY.
Parent topic:
Changing data in a table using the UPDATE statement