DELETE¶
Valid in: SQL, ESQL, DBProc, OpenAPI, ODBC, JDBC, .NET
The DELETE statement deletes rows from the specified table that satisfy the search_conditionin the WHERE clause. If the WHERE clause is omitted, the statement deletes all rows in the table. The result is a valid but empty table.
This statement has the following formats:
Interactive version:
Embedded non-cursor version:
- table_name
-
Specifies the name of the table from which rows are to be deleted.
- corr_name
-
Specifies a correlation name for the table for use in the search_condition.
DELETE Examples¶
- Delete from the sales_fact table where the year is last year:
INSERT INTO sales_fact VALUES ('2013-02-28', 120, 23.8),('2014-04-30', 1, 3.8),('2012-08-14', 30, 44.0),('2013-11-01', 1, 19.4),('2012-10-12', 3, 14.4);
One row will be deleted.
- Delete all rows from sales_fact: