我想总结下面的列。我该怎么做?
当我使用
sum(DATEDIFF ( HOUR , startDate, endDate) / 10.0 )
它给出了这个输出:
(No column name)
1.000000
0.300000
1.000000
1.000000
1.000000
1.000000
0.300000
我怎样才能总结这一列?
整个查询:
SELECT SUM(DATEDIFF ( HOUR , StartTime , EndTime ) / 10.0 ) FROM [y]
INNER JOIN [x] ON [x].UserID = [y].ID
WHERE StartTime BETWEEN '20120709' AND '20120714' AND UserID = 1
GROUP BY StartTime, [y].ID, [y].Name, EndTime
ORDER BY StartTime