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

oracle insert 批量插入数据,跳过已存在记录

2018-03-29 15:48 615 查看
insert into tree(id,name,pid) select '101','test','10' from dual where not exists(select 1 from tree where id='101');

or
insert when (not exists (select 1 from tree where id='101')) then into tree(id,name,pid) select '101','test','10' from dual;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: