THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
MergeIntoCommand implement
The implement The implementation for MergeIntoCommand is a litter complex than other commandcommands. Look at the follow the following statement.
Code Block | ||
---|---|---|
| ||
merge into h0 as target using ( select * from s0 ) as source on source.id = target.id when matched and delete_flag % 10 != 0 then update set id = source.id, name = source.name, price = source.price + target.source, when matched and delete_flag % 10 = 0 then delete when not matched and delete_flag % 10 != 0 then insert (id,name,price) values(id, name, price + 1) |
...