Oracle if updating then
Is there any additional overhead with an update statement that doesn't update rows vs a select statement?
I'm trying to find out if its better to query with a select then update based on the results.
If the condition is false, the update operation is skipped when merging the row into the target table.
You can specify the DELETE where_clause to clean up data in a table while the MERGE statement is populating or updating it.
Since MERGE combines INSERT and UPDATE operations, you must have the INSERT and UPDATE object privileges on the target table, and of course, the SELECT object privilege on the source table.
The decision to perform an insert or update is based on conditions specified by you.The MERGE statement uses the merge_insert_clause when the condition of the ON clause is false.As with any normal insert, if the insert clause is executed, all insert triggers defined on the target table are fired.USING Clause - The USING clause specifies the source of the data to be updated or inserted.The source for a MERGE statement can be a table, view, or the result of a subquery.