- Documentation
- Installation
- Data Import
- Client APIs
- SQL
- Introduction
- Statements
- Overview
- Select
- Insert
- Delete
- Update
- Create Table
- Create View
- Create Sequence
- Create Macro
- Drop
- Alter Table
- Copy
- Export
- Data Types
- Expressions
- Functions
- Overview
- Numeric Functions
- Text Functions
- Pattern Matching
- Date Functions
- Date Format
- Timestamp Functions
- Blob Functions
- Indexes
- Aggregates
- Window Functions
- Samples
- Pragmas
- Full Text Search
- Development
- Why DuckDB
- FAQ
- Code of Conduct
- Live Demo
- Benchmarking
Delete Statement
The DELETE
statement removes rows from the table identified by the table-name.
Examples
-- remove the rows matching the condition "i=2" from the database
DELETE FROM tbl WHERE i=2;
-- delete all rows in the table "tbl"
DELETE FROM tbl;
Syntax
The DELETE
statement removes rows from the table identified by the table-name.
If the WHERE
clause is not present, all records in the table are deleted. If a WHERE
clause is supplied, then only those rows for which the WHERE
clause results in true are deleted. Rows for which the expression is false or NULL are retained.