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?