gpt4 book ai didi

Oracle 插入如果不存在语句

转载 作者:行者123 更新时间:2023-12-03 08:11:43 25 4
gpt4 key购买 nike

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 插入如果不存在语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10824764/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com