VastbaseE100

基于开源技术的HTAP数据库管理系统。性能优异,稳定可靠,提供诸多专属领域特性。

Menu

MERGE INTO

create table mytab (id int);
MERGE INTO mytab t USING (SELECT 1 as key) s ON s.key = t.id WHEN MATCHED THEN DELETE;
MERGE INTO mytab t USING (SELECT 1 as key) s ON s.key = t.id WHEN not  MATCHED THEN insert values (s.key);
MERGE INTO mytab t USING (SELECT 1 as key) s ON s.key = t.id WHEN not  MATCHED THEN insert values (s.key) WHEN MATCHED THEN UPDATE set id = id +1;