1.原始数据
2.将数据进行转换
2.1小时数据转为日数据
SELECT replace(newid(),'-','') as id
,a.[site_code]
,dateadd(DAY, datediff(DAY, 0, update_date ), 0) as [update_date]
,AVG( convert(int,[pm10])) as pm986
,AVG( convert(int,[pm25])) as pm985
,GETDATE() as [to_update_date]
from t_air_monitor_factor_hour_data_gk a
-- where dateadd(DAY, datediff(DAY, 0, GETDATE())-7, 0)=da