mysql删除表中的后5000条数据

delete from historical_alarm where exists (select * from (select id from historical_alarm limit 1,5000) as a where a.id=historical_alarm.id);

你可能感兴趣的:(mysql,删除表中的后5000条数据)