sql2005统计每天的数据

SELECT count(createdate),REPLACE(CONVERT(varchar(10),createdate,120),N'-0','-') FROM Edu_SearchHotWords

 GROUP BY REPLACE(CONVERT(varchar(10),createdate,120),N'-0','-') ORDER BY CONVERT(datetime,REPLACE(CONVERT(varchar(10),createdate,120),N'-0','-')) desc

你可能感兴趣的:(sql2005)