Using the fh-bigquery:weather_gsod dataset, I want to retrieve some monthly weather data for all stations in a specific country. Namely, I want the monthly avg temp, monthly avg max, and monthly avg min, from 1929 to present.
This what I wrote to retrieve what I need from one table, 2015. The data I get seems correct:
SELECT stn, FIRST(name) AS station_name, mo, (AVG(temp)-32)*0.5556 AS temp, (AVG(max)-32)*0.5556 AS max, (AVG(min)-32)*0.5556 AS min
FROM [fh-bigquery:weather_gsod.gsod2015] gsod
JOIN [fh-bigquery:weather_gsod.stations2] stations
ON gsod.wban=stations.wban AND gsod.stn=stations.usaf
WHERE country='SA'
GROUP BY stn, mo
ORDER BY mo
Assuming that this query does indeed retrieve the info I need, how can I rewrite it so that I can include the whole range (1929 to 2016)?