我在类型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