1WITH RankedExpenditure AS (
2 SELECT
3 country,
4 year,
5 military_expenditure_of_gdp,
6 RANK() OVER (PARTITION BY year ORDER BY military_expenditure_of_gdp DESC) AS rank
7 FROM
8 "@kaggle.prasertk_military_expenditure_by_country_from_19702020.military_expenditure"
9)
10SELECT
11 country,
12 year,
13 military_expenditure_of_gdp
14FROM
15 RankedExpenditure
16WHERE
17 rank = 1
18ORDER BY
19 year DESC;
20