<iframe src="https://exploratory.io/viz/felipehoffa/3489810742680140?embed=true" frameborder="0" width="100%" height="100%" > </iframe>
SELECT * FROM (
SELECT , ROUND(AVG(temp) OVER(PARTITION BY country), 2) country_avg
FROM (
SELECT c.country, stn, ROUND((AVG(temp)-32)5/9, 2) temp
, COUNT(stn) OVER(PARTITION BY c.country) country_stations
, ANY_VALUE(continent) continent
FROM bigquery-public-data.noaa_gsod.gsod2016
a
JOIN bigquery-public-data.noaa_gsod.stations
b
ON a.stn=b.usaf AND a.wban=b.wban
JOIN gdelt-bq.extra.countryinfo2
c
ON b.country=c.fips
GROUP BY 1, 2
)
WHERE country_stations>10
OR country='Singapore'
)
ORDER BY country_avg