Update statement is used to update the records in tables however it become complex task when we need to update the records on JOIN condition with other tables.
MERGE INTO set of commands is efficient way to do the same.
Syntax :
MERGE INTO tablename
USING { query| tablename } on { condition }
[ WHEN MATCHED THEN UPDATE set_clause
[ DELETE CONDITION ]
[ WHEN NOT MATCHED THEN INSERT values_clause ]
MERGE INTO set of commands is efficient way to do the same.
Syntax :
MERGE INTO tablename
USING { query| tablename } on { condition }
[ WHEN MATCHED THEN UPDATE set_clause
[ DELETE CONDITION ]
[ WHEN NOT MATCHED THEN INSERT values_clause ]
No comments:
Post a Comment