Original Post
Hi I am working on MySQL 5 and want to delete all entries but the lastest 50 entries from a table. Unfortunately MySQL doesn t support DELETE FROM LIMIT 49,999999; So one way I thought of would be to SELECT the 50th auto_increment column entry into a variable and delete all entries with auto_column < variable My question, is there a one-liner that could do the same without searching the table before deleting? This command is executed quite often so I need to implement a somewhat efficient solution thx in advance