mysql 指定的字段如果重复(已存在),则不再插入

insert into 表名(待插入字段1,待插入字段2,...,待插入字段n)select张三,1,...,袜子from 表名 awhere not exists(select 1 from 表名 b where b.判断条件字段1=张三 and b.判断条件字段2=1 and 判断条件字段n=23531172612)

 

 

 

 

【注】 

where not exists:

如果其后查询出了结果,则该条件成立, 否则,不成立













1

相关文章