sql月,年,统计报表sql报表

我只是一个虾纸丫 提交于 2020-12-19 11:11:55
 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)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!