DELETE
Remove rows from a table.
Syntax
Parameters
| Parameter | Description |
|---|---|
| table | The table to delete rows from |
WHERE condition | Filter which rows to delete. Without WHERE, all rows are removed |
Examples
Delete with condition
DELETE FROM sessions
WHERE expires_at < NOW();
Delete matching a subquery
DELETE FROM orders
WHERE customer_id IN (
SELECT id FROM customers WHERE active = FALSE
);
Delete all rows
DELETE FROM temp_results;