sql DELETE,TRUNCATE,DROP TABLE

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql DELETE,TRUNCATE,DROP TABLE相关的知识,希望对你有一定的参考价值。

-- DELETE FROM, deletes certain rows from a table
DELETE FROM orders1 WHERE OrderID = 36;

-- DELETE FROM, deletes all rows from a table without deleting the table
DELETE * FROM orders1;

-- DROP TABLE, deletes the entire table the entire table, including the structure of the table
DROP TABLE orders;

-- TRUNCATE TABLE clears the entire table in a more efficient, quick manner than DELETE. Storage physically deallocated, rows not individually removed. Will fail if the table is referenced by a foreign key constraint in another table.
TRUNCATE TABLE orders1;

以上是关于sql DELETE,TRUNCATE,DROP TABLE的主要内容,如果未能解决你的问题,请参考以下文章

Sql中truncate,delete以及drop的区别

SQL truncate delete与drop区别[z]

Sql语句中的truncate,delete,drop的区别

sql之truncate delete与drop区别

关于sql 中delete, truncate,drop的理解与总结

SQL语句中的 truncate delete与drop区别