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 ?
Average of day over several years
-
chris
- Site Admin
- Posts: 216
- Joined: Mon Jul 21, 2008 9:52 am
Re: Average of day over several years
Nice project, may I suggest alo add the max and minimum.
The folowing code should be a good start:
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)