实现MySQL插入处理重复键值,IGNORE INTO
作者:数据库 来源:应用开发 浏览: 【大中小】 发布时间:2025-11-04 19:24:29 评论数:

复制MySQL> insert ignore into test1(id,实现name,type)(select id,name,type from test2); Query OK, 3 rows affected (0.01 sec) Records: 4 Duplicates: 1 Warnings: 0 MySQL> select * from test1; +-----+------+------+ | id | name | type | +-----+------+------+ | 101 | aaa | 1 | | 102 | bbb | 2 | | 103 | ccc | 3 | | 203 | ccc | 3 | | 202 | bbb | 2 | | 201 | aaa | 1 | +-----+------+------+ 6 rows in set (0.00 sec) 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.
