the FROM clause – it does make it simple to understand and is a nice feature.
Results after the update: a b c d ———————————— 1 x y z 2 a1 b1 c1 3 t x z DB2 LUW: –Same as Oracle– UPDATE TABLEA SET (b, c, d) = (SELECT b1, c1, d1 from TABLEB WHERE TABLEB.a1 = TABLEA.a and TABLEB.e1 40); Results after the update: a b c d ———————————— 1 x y z 2 a1 b1 c1 3 t x z NOTE: It is very important to make sure that your where clause for the update statement is correct since that is what identifies the records that the update statement is going to qualify and do the update upon.
SET specifies the Table2 column Name will be updated with values of Table1 name column.In this article, we are going to look at four scenarios for Oracle cross table update. Category_ID) where exists ( select * from Categories b where b. These columns uniquely identify a record in a table.Suppose we have two tables Categories and Categories_Test. The common column in the two tables is CATEGORY_ID. Please note that query below is used for illustration purpose because Category_ID alone is primary key.If it is incorrect, then you can get wrong results.The reason I am mentioning this is because I have seen people write wrong where clauses and then wondering what went wrong because they specified the correct condition in the SET clause.