If you have auto_incremnt id in the table you can do the following:
delete from table a where id > start_id and id =< end_id

Or you can delete by timestamp.
delete from table a where date between 'start_date' and 'end_date'.



On 11/6/05, Brian Dunning <[EMAIL PROTECTED]> wrote:
>
> I'd like to delete all but the newest 100 records from a table. I
> have a timestamp field. I can't figure out how to do this in a single
> SQL statement - can anyone help? Thanks!
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>
>

Reply via email to