Home > Database > Mysql Tutorial > How to clear data table data in mysql

How to clear data table data in mysql

青灯夜游
Release: 2021-02-04 10:28:31
Original
44271 people have browsed it

In mysql, you can use the "DELETE" and "TRUNCATE" keywords to clear the data in the data table. The specific syntax is "DELETE FROM data table;" and "TRUNCATE TABLE data table;".

How to clear data table data in mysql

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.

MySQL DELETE keyword

In MySQL, you can use the DELETE statement to delete one or more rows of data in a table.

Use the DELETE statement to delete data from a single table. The syntax format is:

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

The syntax description is as follows: