我在 TIMESTAMP(6) WITH TIME ZONE 类型的数据库中有 2 列。我已经从另一个中减去一个以获得两个时间戳之间的时间。
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。你们都提供了巨大的帮助,我感谢你们抽出宝贵的时间来帮助解决这个问题,并为响应反馈/进一步的问题而不断返回更新的帮助!多谢你们!