DELETE

Updated at:

Use DELETE to remove rows from a table. Always include a WHERE clause to target specific rows.

Syntax

DELETE FROM table_name WHERE where_clause;

Parameters

ParameterDescription
table_nameThe name of the table from which rows are deleted.
where_clauseA Boolean expression that identifies which rows to delete. Rows where the expression evaluates to true are removed.

Examples

Delete rows that match an exact condition

Delete the row where p1 = 10 and p2 = 20:

DELETE FROM dt WHERE p1 = 10 AND p2 = 20;

Delete rows that match a range condition

Delete all rows where p1 is greater than 10:

DELETE FROM dt WHERE p1 > 10;