How to delete specified data from a table in MySQL?

To remove specific data from a MySQL table, you can use the DELETE FROM statement.

The following is the syntax for deleting specific data in a table:

DELETE FROM 表名 WHERE 条件;

The table name is the name of the table from which data will be deleted, while the condition is used to specify which data to delete.

For example, to delete a student with a student ID of “1001” from a table named “students,” you can use the following statement:

DELETE FROM students WHERE 学号 = '1001';

Please be aware that this will permanently delete data in the table that meets the conditions, so please proceed with caution before executing the delete operation and make sure to backup important data.

广告
Closing in 10 seconds
bannerAds