Home >Database >Mysql Tutorial >Oracle的drop、delete、truncate区别

Oracle的drop、delete、truncate区别

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:21:051196browse

drop会删除整个表里的数据表结构。事务不可回滚。 ? 1 drop table test; truncate会删除表里的所有数据,不会逐行操作。且事务无法回滚。 ? 1 truncate table test; delete针对的是每行数据。事务可回滚。 ? 1 delete from test where id=1; truncate针对

 drop会删除整个表里的数据表结构。事务不可回滚。

?

1

drop table test;

truncate会删除表里的所有数据,不会逐行操作。且事务无法回滚。

?

1

truncate table test;

delete针对的是每行数据。事务可回滚。

?

1

delete from test where id=1;

truncate针对的是全表数据,不会做逐行操作,,而delete针对的是每行数据。所以truncate的性能高于delete。

Statement:
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