Skip to main content

DELETE

Delete rows from a table.

Syntax
DELETE FROM <table_name> [AS alias]
[ USING <additional_table_or_query> [, <additional_table_or_query> ] ]
[ WHERE where_conditions ]

Parameters

{{< sql-section file="data/sql/apache-iceberg-tables.json" data="deleting" >}}

note:

Join conditions are not supported in WHERE clauses. If you need to use a join condition, use a correlated subquery instead.

Example of an unsupported DELETE command
DELETE FROM orders
USING returns
WHERE orders.order_id = returns.order_id;

Example

Equivalent DELETE command using a correlated subquery
DELETE FROM orders
WHERE EXISTS (select 1 from returns where order_id = orders.order_id)