我如何总结并找到以下机票年龄的平均值(如图所示)。在这种情况下,票数= 5。我想在下面的单独单元格中显示票证年龄的平均值,并且应采用相同的格式(dd:hh:mm)
这个字段是计算表达式:
s.TicketStatus ='已关闭'然后
trim(abs((CAST(h.auditdate AS DATE) - CAST(t.createdate AS DATE))))|| 'd:'||修剪(abs((EXTRACT(HOUR FROM h.auditdate)) - abs(EXTRACT(HOUR FROM t.createdate))))|| 'h:'|| trim(abs((EXTRACT(MINUTE from h.auditdate) - EXTRACT(MINUTE from t.createdate))))|| 'M'
其他
trim(abs((CAST(current_timestamp AS DATE) - CAST(t.createdate AS DATE))))|| 'd:'|| trim(abs((EXTRACT(HOUR FROM current_timestamp) - EXTRACT(来自t.createdate的时间))))|| 'h:'|| trim(abs((EXTRACT(MINUTE FROM current_timestamp) - EXTRACT(从t.createdate开始))))|| 'M'
结束为“门票年龄”
auditdate:timestamp(3) createdate:timestamp(3) 感谢。