Updating a table from another table in oracle

10 Oct

Sometimes, during ETL or when is necessary to do data cleansing, I need to update a table with data from another table.I have been looking for scripts to do this easily and I have come across MERGE INTO. For recursive subquery factoring, the query name is even visible to the subquery that defines the query name itself.if you want the database to return only one copy of each set of duplicate rows selected. Duplicate rows are those with matching values for each expression in the select list.A query that selects rows from two or more tables, views, or materialized views is a join.You can use the schema qualifier to select from a table, view, or materialized view in a schema other than your own. The object can be a table, view, materialized view, or subquery.

The update query below shows that the PICTURE column is updated by looking up the same ID value in CATEGORY_ID column in table Categories_Test and Categories. If you need to update multiple columns simultaneously, use comma to separate each column after the SET keyword. Here we only want to update PICTURE column in Categories_Test table where the data in Category_Name column is Seafood in table Categories. Software and hardware names mentioned on this site are registered trademarks of their respective companies.If the query in which you specify this clause is not a top-level is subject to the same naming conventions and restrictions as database schema objects.Refer to "Database Object Naming Rules" for information on database object names. ='DHB' ) ; merge into FA_SUBLEDGER_MST s1 using ( select SL_CODE, OFFICE_ID, OFFICE_TYPE from EMPLOYEE_MST where OFFICE_TYPE ! Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.