Skip to content

Instantly share code, notes, and snippets.

@aerodame
Created January 9, 2019 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aerodame/25b9ec2da170dfc2820386b6433dfaa3 to your computer and use it in GitHub Desktop.
Save aerodame/25b9ec2da170dfc2820386b6433dfaa3 to your computer and use it in GitHub Desktop.
SELECT
# Find the average temperature
ROUND(AVG(temp),2) AS temp_avg_f,
stn AS noaa_station_number FROM
(
SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2015` UNION ALL SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2016` UNION ALL SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2017`
)
GROUP BY 2 ORDER BY 1 DESC LIMIT 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment