Home > Database > Mysql Tutorial > body text

How to delete data in the data table

青灯夜游
Release: 2023-01-03 09:30:31
Original
60217 people have browsed it

Method: 1. Use the DELETE statement to delete one or more rows of data in the table. The syntax is "DELETE FROM table name [WHERE clause]"; if the "WHERE clause" is omitted, you can delete the data in the table. All data. 2. Use the "TRUNCATE TABLE table name;" statement to delete all data in the table.

How to delete data in the data table

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

MySQL provides the DELETE and TRUNCATE keywords to delete data in the table.

1. DELETE statement

The DELETE statement can delete one or more rows of data in the table. Syntax format:

DELETE FROM <表名> [WHERE 子句] [ORDER BY 子句] [LIMIT 子句]
Copy after login

The syntax description is as follows: