mysql清除表中所有空行

有时候表中会出现很多空行我们想删除它或者删除某个字段等于特定值的所有行,可以使用如下命令。

命令如下:

delete from tabl where `codes` = '';                  #删除tabl表中codes字段为空的所有行
delete from tabl where `codes` = '123';           #删除tabl表中codes字段为123的所有行

发表评论

您的邮箱地址不会被公开。