当前位置: 首页 > 网络学院 > 服务端脚本教程 > SQL > SQL Delete
The DELETE statement is used to delete rows in a table.
DELETE 声明常用来删除表中的数据。
DELETE FROM table_name |
Person:
LastName | FirstName | Address | City |
---|---|---|---|
Nilsen | Fred | Kirkegt 56 | Stavanger |
Rasmussen | Nina | Stien 12 | Stavanger |
"Nina Rasmussen" is going to be deleted:
"Nina Rasmussen" 的所有个人信息将被删除:
DELETE FROM Person WHERE LastName = 'Rasmussen' |
结果
LastName | FirstName | Address | City |
---|---|---|---|
Nilsen | Fred | Kirkegt 56 | Stavanger |
It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:
可以不删除数据表且删除里面的所有记录行。这就意味着数据表构架,属性以及索引都会完整保留:
DELETE FROM table_name 或 DELETE * FROM table_name |