Remove all rows but most recent of each
DirdSep 11 2009 — edited Sep 11 2009Hi,
I have a table with around 3.6 million rows and came up with an idea of how to improve the speed of a query. Basically my idea was to make a query which removed (ultimately to go into a history table) all records related to a particular area except for the 2 most recent as these are the only ones used. For example:
SPORT || PLAYER || DATE
========================
FOOTBALL RONALDO 08-JUL-09
FOOTBALL RONALDO 11-JUN-09
FOOTBALL RONALDO 22-MAR-09
MMA FEDOR 10-SEP-09
MMA FEDOR 15-AUG-09
MMA FEDOR 11-AUG-09
The idea is that the last ronaldo & fedor records would be deleted somehow...All the things I've tried so far have been a disaster =)
Thanks for any help.
Mike