Skip to content

Commit

Permalink
Merge pull request #6260 from soyeric128/main
Browse files Browse the repository at this point in the history
Doc: Delete-From
  • Loading branch information
BohuTANG authored Jun 27, 2022
2 parents a543c75 + c0425ce commit 4297c79
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/doc/30-reference/30-sql/10-dml/dml-delete-from.md
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
```

1 comment on commit 4297c79

@vercel
Copy link

@vercel vercel bot commented on 4297c79 Jun 27, 2022

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

Please sign in to comment.