-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
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
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,26 @@ | ||
--- | ||
title: "Delete" | ||
date: 2024-01-01T20:40:45+03:30 | ||
--- | ||
With `DELETE` we can delete one or multiple rows from a table. | ||
|
||
{{< tabs tabTotal="1" >}} | ||
{{< tab tabName="PostgreSQL" >}} | ||
```sql | ||
-- when you don't provide a where condition with your delete it will | ||
-- delete all rows in your table | ||
-- Don't run this query on your sample database, until you know what you're doing | ||
DELETE FROM orders; | ||
|
||
-- delete all orders of a user with id of 10 | ||
DELETE FROM | ||
orders | ||
WHERE | ||
user_id = 12; | ||
``` | ||
|
||
Read more about Delete on | ||
[PostgreSQL docs](https://www.postgresql.org/docs/current/sql-delete.html) | ||
|
||
{{< /tab >}} | ||
{{< /tabs >}} |