Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use DELETE statement in SQL

Shulou Source: shulou.com Published: 2022-06-01 13:13:28 10月29日 Update

Editor to share with you how to use the DELETE sentence in SQL. I hope you will get something after reading this article. Let's discuss it together.

SQL DELETE statement

The DELETE statement is used to delete rows from the table, with the following syntax:

DELETE FROM table name WHERE column name = value

"Person" table:

LastName FirstName Address CityCarter Thomas Changan Street BeijingWilson Fred Zhongshan 23 Nanjing

Delete a row

DELETE FROM Person WHERE LastName = "Wilson"

Results:

LastName FirstName Address CityCarter Thomas Changan Street Beijing

Note: the "Fred Wilson" in the "Person" table of this example is deleted.

Delete all rows

You can delete all rows without deleting the table. This means that the structure, properties, and indexes of the table are complete:

DELETE FROM table_name

Or:

DELETE * FROM table_name has finished reading this article. I believe you have some understanding of "how to use DELETE sentences in SQL". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Sentence name article done instance property situation meaning more comment knowledge index structure result industry grammar information information channel channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Technology Linux MySQL Docker