Updating multiple rows in oracle
Every week, table STUDENT needs to be synchronized with the data in STUDENT_N – any new entries for students who attempted the GMAT to be inserted, plus corrections if any made to the existing details.
Below is the TSQL code to create and populate this table.These two different tables will be used in my UDPATE statement examples below.Oracle’s MERGE statement is tailor-made for situations when you want to do an "upsert" i.e.Below is the basic syntax for the UPDATE statement: This is not the complete syntax of the update statement.
If you want to review the complete syntax of the UPDATE statement then please refer to Books Online.
In place of 3 separate unwieldy INSERT, UPDATE and DELETE statements with conditional sub-queries, the all-in-one MERGE does the job in one shot.