SQL DELETE 语句
作者:会飞的
DELETE 语句DELETE 语句用于删除表中的行。语法DELETEFROM表名称WHERE列名称=值Person:LastNameFirstNameAddressCityGatesBillXuanwumen 10BeijingWilsonFredZhongshan 23Nanjing删除某行"Fred Wilson" 会被删除:DELETEFROMPersonWHERELastName='Wilson'结果:LastNameFirstN
DELETE 语句
DELETE 语句用于删除表中的行。
语法
DELETE FROM 表名称 WHERE 列名称 = 值
Person:
LastName | FirstName | Address | City |
---|---|---|---|
Gates | Bill | Xuanwumen 10 | Beijing |
Wilson | Fred | Zhongshan 23 | Nanjing |
删除某行
"Fred Wilson" 会被删除:
DELETE FROM Person WHERE LastName = 'Wilson'
结果:
LastName | FirstName | Address | City |
---|---|---|---|
Gates | Bill | Xuanwumen 10 | Beijing |
删除所有行
可以在不删除表的情况下删除所有的行。这意味着表的结构、属性和索引都是完整的:
DELETE FROM table_name
或者:
DELETE * FROM table_name
猜你喜欢
您可能感兴趣的文章:
- php分页函数
- 从零开始 教你如何搭建Discuz!4.1论坛(图)
- Php部分常见问题总结
- php正则
- 使用Apache的rewrite技术
- python r.hgetall获取所有值
- Unexpected character (< (code 60)): expected a valid value (number, String, array, object, true, false or null)
- Linux性能命令
- phpstorm requisted without authorization
- The following untracked working tree files would be overwritten by checkout
- SQL 简介
- SQL 语法
- SQL SELECT 语句
- SQL SELECT DISTINCT 语句
- SQL WHERE 子句
- SQL AND & OR 运算符
- SQL ORDER BY 子句
- SQL INSERT INTO 语句
- SQL UPDATE 语句