Home > Database > Mysql Tutorial > body text

How to delete a row of data in mysql

青灯夜游
Release: 2022-06-13 18:53:56
Original
46490 people have browsed it

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;".

How to delete a row of data in mysql

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 子句]
Copy after login

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;
Copy after login

How to delete a row of data in mysql

[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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template