Average of day over several years

Post Reply
mister_v
Posts: 188
Joined: Thu Mar 04, 2010 9:19 pm

Average of day over several years

Post by mister_v »

Hi, I making a temperature app
and want to get the avearge temperature a day over several years.

Anyone knows the SQL code to do this ?
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: Average of day over several years

Post by chris »

Nice project, may I suggest alo add the max and minimum.

The folowing code should be a good start:

Code: Select all

SELECT MONTH(datum),DAY(datum),min(temperature),max(temperature),avg(temperature) FROM temperature GROUP BY MONTH(datum),DAY(datum)
Post Reply