It's unclear whether you want the average to be aggregated over days or not.
If you want a different average for midnight on the 26th vs midnight on the 27th, then modify Mabwi's query thus:
SELECT AVG( value ) , thetime
FROM hourly_averages
GROUP BY DATE( thetime ), HOUR( thetime )
Note the additional DATE()
in the GROUP BY
clause. Without this, the query would average together all of the data from 00:00
to 00:59
without regard to the date on which it happened.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…