ArcGIS Pro 3.2.1; mobile geodatabase
I'm trying to learn about different ways to select the greatest n per group in ArcGIS Pro. I came across this old ArcMap article that talks about a possible technique:
Select minimum and maximum values in the Select By Attributes window in ArcMap
Use GROUP BY subquery clauses to return values from aggregate functions on sets of values.
Example #3:
Select the records from the table with the most recent date for sets of values, where <group_ID> is the field that contains the values that define the groups:
<date> = (SELECT MAX(date) FROM <table_name> GROUP BY <group_ID>)
I'll use the SQL expression above to try to select the latest row per species group. The result looks like this:

t_date = (
select
max(t_date)
from
species_records
group by
t_species)That's not the result I was looking for.
This would be the result I'm looking for:

t_date in (
select
max(t_date)
from
species_records s2
where
s2.t_species = species_records.t_species)
What am I missing in that article?
Notes:
- I'm aware that there will be duplicate rows selected per group if there are multiple rows per species that have the same date. Breaking the tie (arbitrarily) would be ideal. But I don't know if that's possible with this particular approach.
- I've attached sample Excel data that can be loaded into a geodatabase.
Thanks.