【发布时间】:2018-06-29 04:39:26
【问题描述】:
我正在做如下插入语句:
Insert into table2 (host, ip, domain, statusnew)
select hostname, ip, domain, "True" from table1 t1, table2 t2
where t1.status = "Done"
and t2.statusnew not regexp "True"
limit 10
;
我添加了声明t2.statusnew not regexp "True" 只是为了确保没有重复插入。但是,它正在添加重复的行。
如何确保没有重复条目?
【问题讨论】:
-
我认为这可能是 table1 t1, table2 t2 重复条目的原因。
标签: mysql join left-join inner-join crud