SQL DELETE 语句讲解

来源:网络时间:2017-03-07 14:02:55

  DELETE 语句用于删除表中的行。

  语法

  DELETE FROM 表名称 WHERE 列名称 = 值

  Person:


LastNameFirstNameAddressCity
GatesBillXuanwumen 10Beijing
WilsonFredZhongshan 23Nanjing

  删除某行

  "Fred Wilson" 会被删除:

  DELETE FROM Person WHERE LastName = 'Wilson'

  结果:


LastNameFirstNameAddressCity
GatesBillXuanwumen 10Beijing

  删除所有行

  可以在不删除表的情况下删除所有的行。这意味着表的结构、属性和索引都是完整的:

  DELETE FROM table_name

  或者:

  DELETE * FROM table_name

文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站) 联系邮箱:9145908@qq.com