How do I delete blank rows in Mysql?

前端 未结 5 1120
忘了有多久
忘了有多久 2021-02-07 18:30

I do have a table with more than 100000 data elements, but there are almost 350 blank rows within. How do I delete this blank rows using phpmyadmin? Manually deleting is a tedio

5条回答
  •  死守一世寂寞
    2021-02-07 18:44

    The general answer is:

    DELETE FROM table_name WHERE some_column = '';
    

    or

    DELETE FROM table_name WHERE some_column IS NULL;
    

    See: http://dev.mysql.com/doc/refman/5.0/en/delete.html

    More info when you post your tables!~

    Also, be sure to do:

    SELECT * FROM table_name WHERE some_column = '';
    

    before you delete, so you can see which rows you are deleting! I think in phpMyAdmin you can even just do the select and then "select all" and delete, but I'm not sure. This would be pretty fast, and very safe.

提交回复
热议问题