sql 条件插入

原普通插入语句:  

insert into seriestable_upload values(New.SeriesID,0);

 加条件后:(当不存在该条数据插入)

insert into customerinfo_upload (CustomerID, upload_status)  
          select  New.CustomerID, '0'  
          from dual where not exists   
          (select * from customerinfo_upload where CustomerID=New.CustomerID and          upload_status='0') 

 加:

  使用replace into;

原文地址:https://www.cnblogs.com/gaara-zhang/p/8822906.html