Baselight
WITH RankedExpenditure AS (
    SELECT 
        country, 
        year, 
        military_expenditure_of_gdp,
        RANK() OVER (PARTITION BY year ORDER BY military_expenditure_of_gdp DESC) AS rank
    FROM 
        "@kaggle.prasertk_military_expenditure_by_country_from_19702020.military_expenditure"
)
SELECT 
    country, 
    year, 
    military_expenditure_of_gdp
FROM 
    RankedExpenditure
WHERE 
    rank = 1
ORDER BY 
    year DESC;
countryyearmilitary_expenditure_of_gdp
Oman202010.8708929599384
Oman20198.63769124071412
Oman20189.5429582801597
Saudi Arabia201710.2238481379874
Oman201612.1195481644179
Saudi Arabia201513.3256723349734
Libya201415.4795763013832
Oman201311.1269749047622
Oman201212.0740661534075
Oman20117.35216518497275
Saudi Arabia20108.56567742612792
Saudi Arabia20099.6171992613664
Georgia20088.52011839531126
Georgia20079.15911651704757
Oman20068.12182993148974
Oman20058.81214185642884
Oman20049.00780996371161
Eritrea200320.8657453093811
Eritrea200220.6718783563252
Eritrea200122.1367915582472
Eritrea200032.6556711938037
Eritrea199934.3777684538841
Eritrea199832.4970666110039
Eritrea199711.8604149677876
Eritrea199620.3448190649491
Eritrea199519.5391124143288
Liberia199429.7276853252648
Eritrea199321.3291139240506
Kuwait199231.7860244470914
Kuwait1991117.34982320869
Kuwait199048.5172672672673
Angola198919.4323333333333
Angola198821.9805
Angola198722.25
Somalia198628.9482415394824
Qatar198524.8464148584695
Saudi Arabia198419.0043483638924
Oman198317.1593698854337
Qatar198219.2773867532936
Israel198120.2622686197897
Israel198018.9193366304698
Israel197919.3846931894808
Israel197822.8911349757844
Israel197723.087213342599
Israel197629.2455930986357
Israel197530.4638027862708
Israel197427.6552864420413
Israel197327.856092653735
Israel197220.3710188427547
Israel197122.7998034775922
Israel197023.4470563207999

Share link

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