INSERT INTO perf_week(node_id,perf_time,pm25,pm10,temp,humi) SELECT node_id,'2016-12-22 11:55:00' AS perf_time,AVG(pm25) AS pm25,AVG(pm10) AS pm10,AVG(curr_temp) AS temp,AVG(curr_humidity) AS humi FROM perf_pm25 WHERE perf_time BETWEEN DATE_SUB('2016-12-22 11:55:00',INTERVAL 1 WEEK) AND '2016-12-22 11:55:00' GROUP BY node_id;
啦啦啦