针对某张表进行插入还是对原有记录进行修改
merge into 表名 a using
(select 需要查找的记录关键字值 as userid from dual) b on (a.userid = b.userid )
when matched then
update set newnum = newnum + 1
when not matched then
insert values(关键字值,1)
针对某张表进行插入还是对原有记录进行修改
merge into 表名 a using
(select 需要查找的记录关键字值 as userid from dual) b on (a.userid = b.userid )
when matched then
update set newnum = newnum + 1
when not matched then
insert values(关键字值,1)