Sql statement to delete records of how many future implementations

Ideas: For example, I want to delete a record 100 after

First record 100 to the first search after

by

select * from collect_table limit 100,-1

limit 100, -1 to 101 represents a last search from a collection of records

Then I want to delete this result by deleted

 

Here it is necessary to have a condition where

Usually each record id is a primary key

 

So the final solution is found to be deleted by id

delete from 表名 where id in ( select id from 表名 limit 100,-1);

 

Published 137 original articles · won praise 29 · views 110 000 +

Guess you like

Origin blog.csdn.net/xiexiaotian11/article/details/104559204