日期:2014-05-17 浏览次数:20474 次
select CONVERT(varchar(10), DATEPART(year,getdate()))+'-'+CONVERT(varchar(10), DATEPART(week,getdate()))
select CONVERT(varchar(10),year(datetime_column))+'-'+CONVERT(varchar(10), DATEPART(week,datetime_column)) as year_week,
COUNT(1) as cnt
from table_name
group by CONVERT(varchar(10),year(datetime_column))+'-'+CONVERT(varchar(10), DATEPART(week,datetime_column))