DELETE FROM tablename
WHERE id NOT IN (
SELECT id FROM tablename
ORDER BY created DESC
LIMIT 10);
DELETE FROM tablename
WHERE id NOT IN (
SELECT id FROM tablename
ORDER BY created DESC
LIMIT 10);