Baselight
WITH RankedExpenditure AS (
    SELECT 
        country, 
        year, 
        military_expenditure_current_usd,
        RANK() OVER (PARTITION BY year ORDER BY military_expenditure_current_usd DESC) AS rank
    FROM 
        "@kaggle.prasertk_military_expenditure_by_country_from_19702020.military_expenditure"
    WHERE 
        country NOT IN ('High Income','High income', 'Post-demographic dividend', 'OECD members', 'World', 'Europe & Central Asia')
)
SELECT 
    country, 
    year, 
    military_expenditure_current_usd
FROM 
    RankedExpenditure
WHERE 
    rank = 3
ORDER BY 
    year DESC;
countryyearmilitary_expenditure_current_usd
IDA & IBRD total2020600857814203.535
IDA & IBRD total2019595116361898.601
IDA & IBRD total2018577902662190.883
IDA & IBRD total2017562994858035.029
IDA & IBRD total2016525830278646.314
IDA & IBRD total2015522730064681.965
IDA & IBRD total2014545775442586.666
IDA & IBRD total2013533368599364.373
IDA & IBRD total2012493904136230.484
IDA & IBRD total2011454716401355.366
IDA & IBRD total2010401238678249.102
IDA & IBRD total2009358363127192.814
IDA & IBRD total2008343097778598.969
IDA & IBRD total2007281244795641.939
IDA & IBRD total2006231525817291.756
IDA & IBRD total2005231867859034.447
IDA & IBRD total2004198720514048.24
IDA & IBRD total2003169326420076.713
IDA & IBRD total2002142437509529.974
IDA & IBRD total2001141656845937.262
IDA & IBRD total2000133855335939.685
European Union1999134771601043.013
European Union1998136365802143.604
European Union1997136006909348.575
European Union1996151107237217.014
European Union1995150118116061.682
European Union1994136796281127.096
European Union1993134267004334.905
European Union1992149794667210.87
European Union1991141777967606.802
European Union1990144150726942.553
European Union1989120905535626.789
European Union1988121389051111.622
European Union1987114625498831.168
European Union198693568290629.3052
European Union198570034111385.1678
Early-demographic dividend198470380199740.1248
European Union198372051228255.7135
Early-demographic dividend198274683847924.959
European Union198175796843418.47
European Union198083972602866.4606
European Union197976314836150.6288
European Union197872659006959.8945
European Union197768394880301.2181
European Union197660394849125.746
European Union197558266277180.9908
European Union197450474967626.7978
European Union197344817329700.7752
European Union197237687223512.7043
European Union197132207588918.5162
European Union197028775441169.0029

Share link

Anyone who has the link will be able to view this.