1 select 2 DevName as 设备名称, 3 count(flux) as 流量数据个数, 4 max(flux) as 流量最大值, 5 min(flux) as 流量最小值, 6 avg(flux) as 流量平均值, 7 count(Flux_AV) as 流速数据个数, 8 max(Flux_AV) as 流速最大值, 9 min(Flux_AV) as 流速最小值, 10 avg(Flux_AV) as 流速平均值 11 from realtime 12 where 13 year(savetime)='2013' 14 and month(savetime)='5' 15 GROUP BY DevName, 16 datepart(yy,savetime), 17 datepart(mm,savetime)