我在類型TIMESTAMP(6)與時區數據庫有2列的列表。我已經從另一箇中減去一個來獲得兩個時間戳之間的時間。平均TIMESTAMP(6)與TIME ZONE次
select lastprocesseddate-importeddate
from feedqueueitems
where eventid = 2213283
order by written desc;
我怎樣才能得到我有的時間差異列表的平均值?
這裏有時間差的小樣本:
+00 00:00:00.488871
+00 00:00:00.464286
+00 00:00:00.477107
+00 00:00:00.507042
+00 00:00:00.369144
+00 00:00:00.488918
+00 00:00:00.354797
+00 00:00:00.378801
+00 00:00:00.320040
+00 00:00:00.361242
+00 00:00:00.302327
+00 00:00:00.331441
+00 00:00:00.324065
編輯:我也注意到 - 我已經嘗試AVG函數,它只是返回
ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
Error at Line: 3 Column: 29
EDIT2:只是澄清上述片段。第3行是我的SQL查詢,其格式如下:
select AVG(lastprocesseddate-importeddate) from feedqueueitems where eventid = 2213283;
EDIT3:非常感謝Matt和Alex Poole。你倆都有助於大規模和我感謝您抽出寶貴的時間來幫助這一點,雙方始終與更新的幫助響應反饋/其他問題包退!多謝你們!
的【如何平均時間間隔?](http://stackoverflow.com/questions/450581/how-to-average-time-intervals) – GolezTrol