Presto 0.141t Documentation

12.7. DELETE

12.7. DELETE

Synopsis

DELETE FROM table_name [ WHERE condition ]

Description

Delete rows from a table. If the WHERE clause is specified, only the matching rows are deleted. Otherwise, all rows from the table are deleted.

Examples

Delete all line items shipped by air:

DELETE FROM lineitem WHERE shipmode = 'AIR';

Delete all line items for low priority orders:

DELETE FROM lineitem
WHERE orderkey IN (SELECT orderkey FROM orders WHERE priority = 'LOW');

Delete all orders:

DELETE FROM orders;

Limitations

Only Hive Connector currently supports DELETE and it works for the queries where one or more partitions are deleted entirely.