delete 语句用于删除表中的行。
delete from 表名称 where 列名称 = 值
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
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
SQL Server免费版的安装以及使用SQL Server Management Studio(SSMS)连接数据库的图文方法
SQL Server 2017 Developer的下载、安装、配置及SSMS的下载安装配置(图文教程详解)
网友评论