How to delete a range of records at once on MySQL?

前端 未结 4 448
野性不改
野性不改 2020-12-09 00:48

I have rows over 60000 in my table. How can I delete rows from 40000 to 50000 at once?

4条回答
  •  孤街浪徒
    2020-12-09 01:36

    If you dont have a primary key and want to delete by row count i.e row range, it can be done via mysql export import. Do a custom export - Specify the start row and count. In your case, you ll need two exports: one for rows 0 - 40k, second for 50-last. Then import those two files into the table. Note: If importing large files is a problem, I recommend BigDump. http://www.ozerov.de/bigdump/

提交回复
热议问题