PostgreSQL · Command
DELETE
DELETE removes rows that match a condition from a PostgreSQL table. Without WHERE, it removes every row in the table.
Last updated
Syntax
[ WITH [ RECURSIVE ] with_query [, ...] ] DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ] [ USING from_item [, ...] ] [ WHERE condition | WHERE CURRENT OF cursor_name ] [ RETURNING [ WITH ( { OLD | NEW } AS output_alias [, ...] ) ] { * | output_expression [ [ AS ] output_name ] } [, ...] ]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
TRUNCATEUPDATESELECTUSINGRETURNINGWHERE CURRENT OFWITH