-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6260 from soyeric128/main
Doc: Delete-From
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: DELETE | ||
--- | ||
|
||
Removes one or more rows from a table. | ||
|
||
## Syntax | ||
|
||
```sql | ||
DELETE FROM table_name | ||
[WHERE search_ condition] | ||
``` | ||
|
||
:::tip | ||
The DELETE statement does not support the USING clause yet. | ||
::: | ||
|
||
## Examples | ||
|
||
```sql | ||
-- create a table | ||
CREATE TABLE bookstore ( | ||
bookId INTEGER PRIMARY KEY, | ||
bookName TEXT NOT NULL | ||
); | ||
|
||
-- insert values | ||
INSERT INTO bookstore VALUES (101, 'After the death of Don Juan'); | ||
INSERT INTO bookstore VALUES (102, 'Grown ups'); | ||
INSERT INTO bookstore VALUES (103, 'The long answer'); | ||
INSERT INTO bookstore VALUES (104, 'Wartime friends'); | ||
INSERT INTO bookstore VALUES (105, 'Deconstructed'); | ||
|
||
-- show the table before deletion | ||
SELECT * FROM bookstore; | ||
|
||
101|After the death of Don Juan | ||
102|Grown ups | ||
103|The long answer | ||
104|Wartime friends | ||
105|Deconstructed | ||
|
||
-- delete a book (Id: 103) | ||
DELETE from bookstore where bookId = 103; | ||
|
||
-- show the table again after deletion | ||
SELECT * FROM bookstore; | ||
|
||
101|After the death of Don Juan | ||
102|Grown ups | ||
104|Wartime friends | ||
105|Deconstructed | ||
``` |
4297c79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
databend – ./
databend-databend.vercel.app
databend-git-main-databend.vercel.app
databend.vercel.app
databend.rs