在数据插入时,进行重复性判断,若不存在,则插入,若存在,则不插入,具体示例:
sql示例:
insert into user(name,idcode) select '张三','123' from dual where not exists (select * from user where name='张三' and idcode='123')
在数据插入时,进行重复性判断,若不存在,则插入,若存在,则不插入,具体示例:
sql示例:
insert into user(name,idcode) select '张三','123' from dual where not exists (select * from user where name='张三' and idcode='123')
本文标题:MariaDB 防止数据重复插入
本文链接:https://www.haomeiwen.com/subject/rvatxhtx.html
网友评论