mysql 批量插入,存在则不插入该条数据

 sql语法:

     1.修改该字段属性为 unique;比如 c 字段;

      2.执行sql:insert ignore into tbname(a,b,c) values('1','1','1'),('2','2','2'),('2','2','2');

      3.你会发现只有两条数据;

猜你喜欢

转载自blog.csdn.net/qq_29364417/article/details/78328078