概要

DELETE FROM table_name [ WHERE condition ]

描述

删除表中与 WHERE 子句匹配的行,如果没有指定 WHERE 子句,将删除所有行。

示例

--- 删除匹配行
DELETE FROM lineitem WHERE shipmode = 'AIR';

--- 删除匹配行
DELETE FROM lineitem
WHERE orderkey IN (SELECT orderkey FROM orders WHERE priority = 'LOW');

--- 清空表
DELETE FROM orders;

局限

部分连接器可能不支持DELETE