Details
Description
Here is three sql:
1:
MERGE INTO transactions AS T
USING merge_source AS S
ON T.id = S.id
WHEN MATCHED THEN UPDATE SET name='update' ;
2:**
MERGE INTO transactions AS T
USING merge_source AS S
ON T.id = S.id
WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.NAME,'321');
3:**
MERGE INTO transactions AS T
USING merge_source AS S
ON T.id = S.id
WHEN MATCHED THEN UPDATE SET name='update'
WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.NAME,'321');
There is no error log , just the table rows is not expected when i run sql3 , it looks like nothing changed.
finally
I need use sql1 and sql2 to replace sql3 , and to make sure the table rows is expected .**