In the update operation for a table, in many cases, you need to refer to data other than the table you want to update in an expression. Like SQL Server provides the FROM clause of the update, you can connect the table you want to update with its data source. Although only one table can be updated, it is possible to reference data other than the table to be updated in an update expression by connecting the table that will be updated with its data source.
For example:
UPDATE Table2 SET = + Table1.colb from INNERJOINon= Table1.cola);
The actual update is performed on the table to be updated, not on the new result set formed by the FROM clause.
Oracle does not have the update from syntax, and can be used in two ways to achieve the same functionality:
Subquery Update A SET a.name= (SELECT b.name from B WHERE b.id=a.id), this query is based on the specific situation to see if the work is as follows.
Single example: UPDATE A SET a.name= (select b.name from B where b.id=a.id) where a.id in (select ID from B)
Multiple example: UPDATE order_rollup SET (qty,price) = (SELECT sum (qty), SUM (price) from Order_lines where customer_id= ' KOHL ') where Cust _id= ' KOHL ' and order_period=to_date (' 01-oct-2000 ')
You can also use it in conjunction with a view.
There are three points to note:
1. For a given A.keyfield value, SELECT b.fieldsource from TableB b WHERE A.keyfield = B.keyfield value can only be a unique value and cannot be a multivalued value.
2. In most cases, the WHERE EXISTS clause in the final face is important, otherwise the result will be incorrect.
3. Limitations for View updates: If the view is based on connections from multiple tables, the ability to record the user update view is limited. The base table of the view cannot be updated unless update involves only one table and the View column contains the entire primary key of the table being updated.
Cut from: http://www.cnblogs.com/JasonLiao/archive/2009/12/23/1630895.html
Oracle-update from explanation