SQL server 按小时统计一天的数据
select right(100+a,2)+ ' -- '+right(100+b,2)+ ' ' as DtTime,
sum( case when datepart(hour,DtTime)> =a and datepart(hour,DtTime)
from DtRecords c , (select 0 a,1 b union all select 1,2 union all se
原创
2016-12-15 18:14:44 ·
9446 阅读 ·
0 评论