我创建了一个查询,它总结了各个日期时间的间隔
select sum(ts_polling) / count(ts_polling) as Average_Queue_Wait_Time , cast(time_start AS Date)
from callcent_queuecalls group by cast(time_start AS date) order by time_start DESC;
有没有办法将Average_Queue_Wait_Time从间隔数据类型转换为数字?
答案 0 :(得分:1)
你可以在这样的时间间隔内获得秒数:
SELECT EXTRACT(epoch FROM INTERVAL '1 day 30 minutes 1.234 seconds');
┌───────────┐
│ date_part │
├───────────┤
│ 88201.234 │
└───────────┘
(1 row)