Files
oceanbase/docs/docs-cn/7.developer-guide-1/3.about-dml-statements-and-transactions/1.about-dml-statements/4.about-the-delete-statement.md
2022-02-10 14:51:49 +08:00

653 B

关于 DELETE 语句

DELETE 语句用来删除表中的记录。

简单的 DELETE 语句格式如下:

DELETE FROM table_name [ WHERE condition ] ;

其中,WHERE 条件子句是可选的,如果没有提供就全表删除。如果表记录数多达几百万以上,会形成大事务,可能会有性能问题。建议带上 WHERE 条件分批删除;或者使用 TRUNCATE TABLE 语句。

示例:删除表中数据

delete from ordr where o_w_id=2;

delete from ordr ;

除了 DELETE 语句外,REPLACE INTO 语句也可能会删除数据。