- Documentation
- Installation
- Data Import
- Client APIs
- SQL
- Introduction
- Statements
- Overview
- Select
- Insert
- Delete
- Update
- Create Schema
- Create Table
- Create View
- Create Sequence
- Create Macro
- Drop
- Alter Table
- Copy
- Export
- Query Syntax
- Data Types
- Expressions
- Functions
- Overview
- Numeric Functions
- Text Functions
- Pattern Matching
- Date Functions
- Timestamp Functions
- Time Functions
- Interval Functions
- Date Formats
- Date Parts
- Blob Functions
- Nested Functions
- Indexes
- Aggregates
- Window Functions
- Samples
- Configuration
- Pragmas
- Development
- Sitemap
- Why DuckDB
- FAQ
- Code of Conduct
- Live Demo
Delete Statement
Version 0.3.2
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.
The USING
clause allows deleting based on the content of other tables or subqueries.
Search Shortcut cmd + k | ctrl + k