So I tried this code I found on https://www.sqlines.com/mysql/how-to/get_top_n_each_group
SELECT city, country, population
FROM
(SELECT city, country, population,
ROW_NUMBER() OVER (PARTITION BY country ORDER BY population DESC) as country_rank
FROM cities) ranked
WHERE country_rank <= 2;
And I got the results that I wanted when I used it in DBeaver, the top 2 rows of each group. But now I need use on MS Access. MS Access doesn’t use ROW_NUMBER()OVER (PARTITION BY so I have been searching for an alternative solution because none of the codes I’ve come across worked out for my database. I need help finding an alternative of this code for MS Access. Edit: This question is not duplicated, I have checked multiple times