sql 查找将呼叫发送到CRM的平均延迟。参数:lskin(l.lskinid),date(p.call_begin_datetime)和outbound(n.isoutbound,0 = ib,1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 查找将呼叫发送到CRM的平均延迟。参数:lskin(l.lskinid),date(p.call_begin_datetime)和outbound(n.isoutbound,0 = ib,1 相关的知识,希望对你有一定的参考价值。

SELECT l.refname, max(l.lskinid) AS 'lskin', AVG(DATEDIFF(SECOND,p.call_begin_datetime,s.lastAttempt))/60 AS 'Share Time'
FROM z.z2.dbo.xcall_share s
 JOIN z.z2.dbo.xxml_join j ON j.xxml_joinid = s.frn_xxml_joinid
    JOIN lskin l ON l.lskinid = j.frn_lskinid
 JOIN vwXCall_ShortLong_Platform p ON p.frn_callid = s.frn_callid
  JOIN vwXCall_ShortLong_Details d ON d.frn_callid = s.frn_callid
  JOIN dnis n ON n.lednis = p.dnis
WHERE l.lskinid = 61926
  AND p.call_begin_datetime >= '2017-03-01'
  AND n.isoutbound = 0
GROUP BY l.refname
ORDER BY 'Share Time' desc

以上是关于sql 查找将呼叫发送到CRM的平均延迟。参数:lskin(l.lskinid),date(p.call_begin_datetime)和outbound(n.isoutbound,0 = ib,1 的主要内容,如果未能解决你的问题,请参考以下文章

CRM系统怎么实现通话功能?

Hibernate的抓取策略(优化)

sql查找数据并计算平均值

SQL - 查找0到人口平均值之间的百分比

查找总成本低于平均 SQL

发送的参数与函数 def 不匹配