MySQL Forums
Forum List  »  Newbie

Re: How do I delete all but most recent record?
Posted by: dump3
Date: July 25, 2005 10:39AM

Christian Hamel wrote:
> If the table is really huge, I would suggest that
> you dump the most recent entries into a temporary
> table using a Select Distinct clause, truncate the
> table and reload the entries from the temporary
> table.

Thank you, Christian. If I could get the query Andrew describes working, then I think the size would be manageable -- and I can simply run the "purge" nightly to keep it in check. However, if I'm unable to that, can you point me to an example that could help me do what you're describing with the temporary table and be able to select distinct based on the name AND ip_address -- even though the date (running_time) is unique on every record?

Options: ReplyQuote


Subject
Written By
Posted
Re: How do I delete all but most recent record?
July 25, 2005 10:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.