in reply to Comparing rows keeping latest

It might be more efficient to have your SQL statement perform this logic. Should be simple enough. Otherwise, you'll want to use a module like Date::Calc or Date::Manip to compare the dates.

Neil Watson
watson-wilson.ca

Replies are listed 'Best First'.
Re^2: Comparing rows keeping latest
by Anonymous Monk on Feb 20, 2006 at 20:11 UTC
    Well I could order by ID then date but would still need to program sql to retrieved the first or last row for each ID. Wouldnt I need to write some PL-SQL to do that? I have less PL-SQL knowledge than I have of Perl, which is sad I know... :(
      You original post states that you want to keep the row with the most recent date. Something like the SQL MAX statement might do the trick. What SQL server are you using?

      Neil Watson
      watson-wilson.ca