Question: I have a mysql table that I need to only contain 20 newest records before adding additional records.
New rows are added daily so I would like it first delete any records that are greater than the 20 allowed starting with the earliest.

The table contains an auto increment "id" column so I can easily determine which is the earliest records.

Thanks for any help.

Answer: 
There is no `offset` for `delete` statement. 
Please see <https://stackoverflow.com/a/8303440/2576076>, it offers a good solution.
Use `DELETE` with `ORDER BY` and `LIMIT`:

```
DELETE FROM MyTable
ORDER BY MyTable.id DESCENDING
LIMIT 20,18446744073709551615;

```

This will leave the 20 records with the largest `id` and delete the rest.