How to Delete All Empty Rows in MySQL Tables

Sometimes a table accumulates many empty rows, or you need to delete all rows where a specific field equals a certain value. You can use the following commands.

The commands are as follows:

delete from tabl where `codes` = '';                  # Delete all rows from the tabl table where the codes field is empty
delete from tabl where `codes` = '123';           # Delete all rows from the tabl table where the codes field equals 123

Leave a Comment

Your email address will not be published.