Oracle sql updating multiple rows
The WHERE clause specifies which record(s) that should be updated.IN operator is used to checking a value within a set of values.
To properly show you how to use the UPDATE statement I will need to create a few tables to hold some sample data. Below is the code to create my Toy table: In order to show you how to UPDATE a table from data in another table I need to build a second sample data table that I will call New Toy Price.
Oracle Tutorials Oracle Tutorials - Update Values on Multiple Rows By: (Continued from previous topic...) How To Update Values on Multiple Rows?
If the WHERE clause in an UPDATE matches multiple rows, the SET clause will be applied to all matched rows.
The UPDATE portion of the code works in an identical fashion to the Implicit Cursor Loop, so this is not really a separate "UPDATE" method as such.
The interesting thing about this method is that it performs a context-switch between PL/SQL and SQL for every FETCH; this is less efficient.