我在計算平均時間時遇到問題。 這種情況下: 我有多行,在每一行有數據的時間格式 ,所以我需要計算所有行的平均時間,並將其乘以行數,但當然我有一個數據格式的問題因爲我需要乘以整數時間T-SQL計算平均時間
有人可以幫我一些建議嗎? 日Thnx 下面是一些數據:
times
00:00:00.7400000
00:00:01.1870000
00:00:00.6430000
00:00:00.6100000
00:00:12.9570000
00:00:01.1000000
00:00:00.7400000
00:00:00.5300000
00:00:00.6330000
00:00:01.6000000
00:00:02.6200000
00:00:01.0300000
00:00:01.9630000
00:00:00.9800000
00:00:01.0170000
00:00:00.7600000
00:00:00.7130000
00:00:00.9730000
00:00:01.0000000
00:00:01.0530000
00:00:02.9400000
00:00:00.8200000
00:00:00.8400000
00:00:01.1800000
00:01:25.8230000
00:00:01.0000000
00:00:00.9700000
00:00:01.2930000
00:00:01.3270000
00:00:13.5570000
00:00:19.3170000
00:00:58.2730000
00:00:01.6870000
00:00:18.7570000
00:00:42.8570000
00:01:12.3770000
00:00:01.2170000
00:00:09.9470000
00:00:01.4730000
00:00:00.9030000
00:00:01.0070000
00:00:01.1100000
00:00:01.6270000
00:00:05.0570000
00:00:00.6570000
00:00:00.7900000
00:00:03.2930000
00:00:00.8600000
00:00:01.0330000
00:00:00.9300000
00:00:00.8730000
00:00:00.9600000
00:00:00.8070000
NULL
從這些數據
,使數據的需要的平均時間和/或總和
您需要將「2013-01-13 08:00 am」乘以整數? – 2013-03-11 22:05:20
您想如何乘以Date和Integer值? 12/12/2012 * 12'應該是什麼結果?! – MarcinJuraszek 2013-03-11 22:05:28
如果您取所有行的平均值並將其乘以行數,是否與所有行的總和不相同? – 2013-03-11 22:06:04