mysql 中插入数据查重sql语句
insert into tt(name,password) select 'phl','123' from dual where not exists(select * from tt where name='phl' and password='123')
这个SQL语句的含义是,如果插入的数据 name='phl',password='123'不存在,则执行插入;
insert into tt(name,password) select 'phl','123' from dual where not exists(select * from tt where name='phl' and password='123')
这个SQL语句的含义是,如果插入的数据 name='phl',password='123'不存在,则执行插入;