admin

MERGE语句在Informix v10中不起作用

sql

我尝试使用merge语句在Informix v10.0中进行插入/更新,但是会引发语法错误:

create table source(id int, account int, age int);
create table target (id int, account int, age int);

insert into source values(1, 1200, 25);
insert into source values(2, 1300, 28);
insert into source values(3, 1400, 45);

merge into target t 
using source s on t.id = s.id
when matched then
update
set t.id = s.id, t.account = s.account, t.age = s.age
when not matched then
insert (t.id, t.account, t.age)
values (s.id, s.account, s.age);

select * from target;

能否请你帮忙?


阅读 181

收藏
2021-07-01

共1个答案

admin

MERGE语句在Informix 10.00中不可用。它是在11.50中添加的-
请参见SQL语法手册中的MERGE语句。该新功能的页面显示它在11.50.xC6,通过维护版本循环方式的一部分加入。

请注意,不支持版本10.00和所有11.x版本(11.10、11.50、11.70)。版本11.70于2020-10-01不再支持。

2021-07-01