mysql TRUNCATE语句
时间: 2023-10-21 19:25:21 浏览: 90
mysql TRUNCATE语句用于清空表中的所有记录。使用TRUNCATE语句后,表的结构仍然存在,但是所有的数据都被删除了。执行TRUNCATE语句后,表的自增id值会被重置为1。在执行TRUNCATE语句时,不会触发触发器,也不会产生任何日志记录。同时,TRUNCATE语句的执行速度比DELETE语句快,因为它是直接删除整个表的数据。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [mysql的truncate](https://blog.csdn.net/qq_43287952/article/details/106885388)[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%"]
- *3* [MySQL删除数据Delete与Truncate语句使用比较](https://download.csdn.net/download/weixin_38748875/12834972)[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 ]
阅读全文