SET NOCOUNT ON SELECT COUNT(1) AS Total, day(InsertTime) as [Day] FROM Count_DataUpload GROUP BY day(InsertTime) SELECT COUNT(1) AS Total, month(InsertTime) AS [Month] FROM Count_DataUpload GROUP BY month(InsertTime) SELECT COUNT(1) AS Total, year(InsertTime) AS [Year] FROM Count_DataUpload GROUP BY year(InsertTime)
显示结果:
Total Day
----------- -----------
45 20
Total Month
----------- -----------
45 11
Total Year
----------- -----------
45 2013
有没有办法把这3个查询转换成
Year YearTotal Month MonthTotal Day DayTotal
2013 45 11 45 20 45
烙印99
相关分类