http://topic.csdn.net/t/20030310/21/1514172.html


select   year(列名)   年,datepart(week,列名)   周,count(*)   from   表   group   by   datepart(year,列名),datepart(week,列名)


select   year(列名)   年,datepart(qq,列名)   季度,count(*)   from   表   group   by   datepart(year,列名),datepart(qq,列名)





本文转载:CSDN博客