insert ignore into
时间: 2023-10-07 16:06:23 浏览: 165
insert ignore into是一种用于向数据库插入数据的SQL语法。它的作用是忽略数据库中已经存在的数据,只插入新的数据。如果数据库中已经存在相同的数据,insert ignore into语句将会跳过这条数据,不进行插入操作。
使用insert ignore into语法插入数据时,如果发生主键冲突,数据库会给出警告(warnings),可以通过show warnings命令查看警告信息。同时,本次插入将被视为无效,不会对数据库进行任何更改。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [MySQL中的insert ignore into讲解](https://blog.csdn.net/zgaoq/article/details/124432806)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [MySQL的insert ignore into, replace into用法](https://blog.csdn.net/weixin_44937881/article/details/109112691)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文