The following statement gives me the average wind speed and total production for each day, grouped by site ID and plant number.
SELECT STE_ID, PNT_NO, T_SMP, AVG(AVR_WS), SUM(AVR_PW) FROM argosrecord GROUP BY STE_ID , PNT_NO , YEAR(T_SMP) , MONTH(T_SMP) , DAY(T_SMP)
I would like to adapt this query to calculate the average and sum from 2am to 2am instead of midnight to midnight.
For those using MySQL :