sql语句语法多表关联_SQL Delete语句-如何删除行或表,语法示例

sql语句语法多表关联

To delete a record in a table you use the  DELETE  statement.

要删除表中的记录,请使用DELETE语句。

Be careful. You can delete all records of the table or just a few. Use the  WHERE  condition to specify which records do you want to delete. The syntax is:

小心。 您可以删除表中的所有记录或仅删除一些记录。 使用WHERE条件指定要删除的记录。 语法为:

DELETE FROM table_name
WHERE condition;

Here is an example deleting from the table Person the record with Id 3:

这是从表Person中删除ID为3的记录的示例:

DELETE FROM Person
WHERE Id = 3;

Using DELETE to remove all records from a given table

使用DELETE从给定表中删除所有记录

DELETE * FROM Person
;

Or depending on your RDBMS you could use the TRUNCATE TABLE statement which deletes all records from a table and depending on your RDBMS may or may not allow rollback. DELETE is DML and TRUNCATE is DDL.

或者根据您的RDBMS,您可以使用TRUNCATE TABLE语句从表中删除所有记录,并且取决于您的RDBMS是否允许回滚。 DELETE是DML,TRUNCATE是DDL。

TRUNCATE TABLE Person;

翻译自: https://www.freecodecamp.org/news/sql-delete-statement-row-table/

sql语句语法多表关联

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值