Oracle插入if not exists语句

前端之家收集整理的这篇文章主要介绍了Oracle插入if not exists语句前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
insert into OPT (email,campaign_id) values('mom@cox.net',100)
where not exists( select * from OPT where (email ="mom@cox.net" and campaign_id =100)) ;

Error report: sql Error: ORA-00933: sql command not properly ended
00933. 00000 – “sql command not properly ended”
*Cause:
*Action:

如何在Oracle中不存在新行?

insert into OPT (email,campaign_id) 
select 'mom@cox.net',100
from dual
where not exists(select * 
                 from OPT 
                 where (email ="mom@cox.net" and campaign_id =100));

猜你在找的Oracle相关文章