长沙市近一周空气质量逐日平均值

2012-2-16到2012-2-23

select year(a.date1) as year1,month(a.date1) as month1,day(a.date1) as day1,avg(a.so2) as so2,avg(a.no2) as no2,avg(a.pm) as pm from (select cast(yy+'-'+mm+'-'+dd+' '+hh+':00:00' as smalldatetime) date1,dwcode,so2,no2,pm from wuran where hh<=20 and cast(yy+'-'+mm+'-'+dd+' '+hh+':00:00' as smalldatetime)>=DATEADD(dd,-1,'2012-2-16') and cast(yy+'-'+mm+'-'+dd+' '+hh+':00:00' as smalldatetime)20 and cast(yy+'-'+mm+'-'+dd+' '+hh+':00:00' as smalldatetime)>=DATEADD(dd,-1,'2012-2-16') and cast(yy+'-'+mm+'-'+dd+' '+hh+':00:00' as smalldatetime)<'2012-2-23') a where a.date1>='2012-2-16' and a.date1
So2 级别 No2 级别 Pm10 级别