MySQL Forums
Forum List  »  Newbie

Re: How do I delete all but most recent record?
Posted by: dump3
Date: July 26, 2005 05:51PM

I understand. I appreciate your efforts to help.

Is there anyone that can suggest an alternative solution? Someone earlier suggested using a temporary table. If that's the only solution, I don't mind using it. I can just leave a a temporary table out there -- empty it each night, and select out only the records required -- place them into the holding table -- and them empty the original table and move from the holding table to the original.

However, I'm now a bit CONFUSED on the syntax and what would be the best way to select out just the lastest (running_time) unique records where there is a distinct member_name AND ip_address field in the record.

I'm clear on deleting the tables, can someone help with queries that would select out the only the latest based on running_time and copy to each the tables? I'll have log_table and log_table_hold as the empty temporary table. Each table will have the following fields:

member_name
member_id
ip_address
running_time
session_id
member_group

The main thing is, we want to keep the latest log of where there is a unique member_name and ip_address pair.

Options: ReplyQuote


Subject
Written By
Posted
Re: How do I delete all but most recent record?
July 26, 2005 05:51PM


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.