Sql Server按小时进行分组统计

SELECT DATEADD(hh,DATEDIFF(hh,0,Date),0) [Hour]
  FROM [t1] 
  group by DATEDIFF(hh,0,Date)

编程技巧