Home > Database > Mysql Tutorial > delete from表名&truncate table表名区别

delete from表名&truncate table表名区别

WBOY
Release: 2016-06-07 14:53:32
Original
2112 people have browsed it

delete from表名truncate table表名区别 1.delete不能使自动编号返回为起始值。 但是truncate能使自动增长的列的值返回为默认的种子 2.truncate只能一次清空,不能按条件删除。 www.2cto.com 但是delete可以按条件清除部分记录。 3.truncate清空数据表性能(


delete from表名&truncate table表名区别

 

1.delete不能使自动编号返回为起始值。

 

但是truncate能使自动增长的列的值返回为默认的种子

 

2.truncate只能一次清空,不能按条件删除。

  www.2cto.com  

但是delete可以按条件清除部分记录。

 

3.truncate清空数据表性能(速度)比delete快。

 

4.truncate不会记录到系统日志,不会触发delete触发器。
 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template