DELETE#

Примечание

Ниже приведена оригинальная документация Trino. Скоро мы ее переведем на русский язык и дополним полезными примерами.

Синтаксис#

DELETE FROM table_name [ WHERE condition ]
Copy to clipboard

Описание#

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.

Примеры#

Delete all line items shipped by air:

DELETE FROM lineitem WHERE shipmode = 'AIR';
Copy to clipboard

Delete all line items for low priority orders:

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

Delete all orders:

DELETE FROM orders;
Copy to clipboard

Limitations#

Some connectors have limited or no support for DELETE. See connector documentation for more details.