您的位置:首页 > 数据库 > Oracle

Oracle 语法 存在则更新否则插入新数据

2016-09-08 00:00 525 查看
merge into my_table mt
using (SELECT [字段A] AS A from dual) t2
on (mt.A = t2.A)
when matched then
update set mt.B= [字段B]
when not matched then
INSERT (A,B)
VALUES([字段A],[字段B])

多用于存储过程
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Oracle