I have a Table that tracks temperatures of a state on different days of different months. I would like to query this table and return the Average Temp for each month of the year. Any thoughts on how to do this?
select avg(temp_field) as AvgTemp, month(date_field) as MonthDate, year(date_field) as YearDate
group by month(date_field), year(date_field)
Code:
SELECT avg(temp_field) as AvgTemp,
month(date_field) as MonthDate,
year(date_field) as YearDate
FROM [tablename]
GROUP BY month(date_field), year(date_field)