删除¶
概要¶
DELETE FROM table_name [ WHERE condition ]
描述¶
从表中删除行。如果指定了 WHERE
子句,则仅删除匹配的行。否则,将删除表中的所有行。
示例¶
删除所有由航空运输的商品项
DELETE FROM lineitem WHERE shipmode = 'AIR';
删除所有低优先级订单的商品项
DELETE FROM lineitem
WHERE orderkey IN (SELECT orderkey FROM orders WHERE priority = 'LOW');
删除所有订单
DELETE FROM orders;
限制¶
某些连接器对 DELETE
的支持有限或没有支持。有关更多详细信息,请参见连接器文档。