直接上sql语句,亲测可用:
DELETE tb FROM lotus_system_log AS tb ,(SELECT pk_id FROM lotus_system_log ORDER BY pk_id desc LIMIT 9,1) AS tmpWHERE tb.pk_id<tmp.pk_id;