merge into table a using
(SELECT * from table where type= '1' ) b
on
(a.id = b.id)
when matched then
UPDATE SET
a.num= a.num+1
when not matched then
INSERT INTO (a.id,a.num)
VALUES ('2','1')
报错 :[Err] ORA-00926: missing VALUES keyword
oracle 数据库版本是 10.2.0.5.0
我的客户端用的 navicat premium
------解决思路----------------------
merge into table a using
(SELECT * from table where type= '1' ) b
on
(a.id = b.id)
when matched then
UPDATE SET
a.num= a.num+1
when not matched then
INSERT (a.id,a.num)
VALUES ('2','1')
下面insert那应该不用写into