For County the following WHERE filter will do it:
Change the two 'county' fields to 'State' to get the equivalent for States.
(Note: you will get multiple results for a County/State if more than one cache shares the same earliest date)
CODE |
not(archived) and code in (select code from caches as c1 where not exists (select 1 from caches as c2 where c1.county=c2.county and c2.placeddate < c1.placeddate)) |
Change the two 'county' fields to 'State' to get the equivalent for States.
(Note: you will get multiple results for a County/State if more than one cache shares the same earliest date)