如何用SQL获取数据库中最近四周的数据?
如何用SQL获取数据库中最近四周的数据?
关按周进行分组
------解决方案--------------------select count (*) as ss,DATEPART (Hour,[time]) as h,iparea from click where [time] between '2007-5-1 ' and '2007-5-30 ' group by iparea,DATEPART (Week,[time]) order by iparea,h