请问如何删除 正数100条以后的所有记录。 或者说 每次保留最新的100条。剩余的全部删除。
delete from `mytable` where typeid=4 order by id desc limit 100,9999
如题 但我这样写不对。
------解决方案--------------------delete from mytable where mytable.id not in
(select id from (SELECT mytable.id from mytable where typeid=4 order by id desc limit 100) c)