当前位置: 首页 > 网络学院 > 服务端脚本教程 > SQL > SQL Drop
You can delete an existing index in a table with the DROP INDEX statement.
你可以将现有的索引通过DROP INDEX语句进行取消操作。
Syntax for Microsoft SQLJet (and Microsoft Access):
在Microsoft SQLJet (和 Microsoft Access)中的语法是这样的:
DROP INDEX index_name ON table_name |
Syntax for MS SQL Server:
MS SQL Server的语法是这样:
DROP INDEX table_name.index_name |
Syntax for IBM DB2 and Oracle:
IBM DB2和Oracle的语法为:
DROP INDEX index_name |
Syntax for MySQL:
MySql则是这样:
ALTER TABLE table_name DROP INDEX index_name |
To delete a table (the table
structure, attributes, and indexes will also be deleted):
删除一张表(表中的数据结构,属性以及索引也会被删除):
DROP TABLE table_name |
To delete a database:
要删除一个数据库的话可以这样写:
DROP DATABASE database_name |
What if we only want to get rid of the data inside a table, and not the table
itself? Use the TRUNCATE TABLE command (deletes only the data inside the table):
当我们只想将表内的数据做完成清楚而保留其内部结构的话,可以使用TRUNCATE TABLE命令(仅仅删除表中的数据)
TRUNCATE TABLE table_name |