Note: Questions and Answers are from the Internet. This article only provides answers for users to learn!
Question:
Answer:
This topic describes the usage of merge. The concepts are as follows:
The merge statement is a new syntax of Oracle9i, used to merge update and insert statements. The merge statement is used to query another table based on the connection conditions of one table or subquery. The join condition matching is updated, and the insert statement cannot be executed. This syntax only requires one full table scan to complete all the work, and the execution efficiency is higher than insert + update.
Usage: Merge [into [schema.] table [t_alias] using [schema.] {table | View | subquery} [t_alias] On (condition) when matched then merge_update_clause when not matched then merge_insert_clause;
In the question, when matched then: first update the row value, and then delete the null row. Therefore, the third row is deleted. Not matched then: the rows that do not meet the conditions are inserted directly, so you can determine the answer.