In mysql, you can use the DELETE statement with the WHERE condition clause to delete a row of data in the data table. The DELETE statement can delete one or more rows of data according to the conditions set by the WHERE clause; delete syntax It is "DELETE FROM table name WHERE field name = field value;".
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
In mysql, you can use the DELETE statement with the WHERE condition clause to delete a row of data in the data table.
DELETE statement can delete one or more rows of data from a single table. The syntax is:
DELETE FROM <表名> [WHERE 子句]
The syntax is as follows:
Table name: Specify the name of the table to delete data.
WHERE clause: Optional. Indicates that the deletion conditions are limited for the deletion operation. If this clause is omitted, it means that all rows in the table are deleted.
Example: Delete a row of data in the table based on conditions
In the tb_courses_new table, delete the record with course_id 4
DELETE FROM tb_courses WHERE course_id=4;
[Related recommendations: mysql video tutorial]
The above is the detailed content of How to delete a row of data in mysql. For more information, please follow other related articles on the PHP Chinese website!