Mysql 插入判断 不存在重复记录则插入
Mysql insert if no exist
由于Mysql没有noexists之类的东西,只能用having 来构造一个false的条件
insert into DRUG_NAME1 (id,name,drug_id) select 7777,'drugname',666 from DRUG_NAME1 t
where t.id=7777 having count(id)=0;
Mysql insert if no exist
由于Mysql没有noexists之类的东西,只能用having 来构造一个false的条件
insert into DRUG_NAME1 (id,name,drug_id) select 7777,'drugname',666 from DRUG_NAME1 t
where t.id=7777 having count(id)=0;