当前位置: 首页 > 网络学院 > 服务端脚本教程 > SQL > SQL Delete

SQL
SQL 介绍
SQL Select
SQL Where 子句
SQL Insert
SQL Update
SQL Delete
SQL 技能测试
SQL Order By
SQL 与 & OR
SQL In
SQL Between
SQL Aliases
SQL Join
SQL Union
SQL Create
SQL Drop
SQL Alter
SQL 函数
SQL Group By
SQL Select Into

SQL Delete


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 1624 ::
收藏到网摘: n/a

DELETE 声明

The DELETE statement is used to delete rows in a table.
DELETE 声明常用来删除表中的数据。

语法

DELETE FROM table_name
WHERE column_name = some_value


Person:

LastName FirstName Address City
Nilsen Fred Kirkegt 56 Stavanger
Rasmussen Nina Stien 12 Stavanger


Delete a Row
删除一条记录

"Nina Rasmussen" is going to be deleted:
"Nina Rasmussen" 的所有个人信息将被删除:

DELETE FROM Person WHERE LastName = 'Rasmussen'

结果

LastName FirstName Address City
Nilsen Fred Kirkegt 56 Stavanger


Delete All Rows
删除所有记录

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

评论 (0) All

登陆 | 还没注册?