tmk业绩统计更新语句
FROM (SELECT dbo.ExtensionWorkers.uExtW_ID, dbo.ExtensionWorkers.cExtW_Name, dbo.ExtensionWorkers.cExtW_JobNumber, (CASE WHEN hd.sl IS NULL THEN 0 ELSE hd.sl END) AS 回单数,
(CASE WHEN yx.sl IS NULL THEN 0 ELSE yx.sl END) AS 有效单数, (CASE WHEN wx.sl IS NULL THEN 0 ELSE wx.sl END) AS 无效单数, (CASE WHEN hf.sl IS NULL
THEN 0 ELSE hf.sl END) AS 回访数, (CASE WHEN bm.sl IS NULL THEN 0 ELSE bm.sl END) AS 报名数, dbo.ExtensionWorkers.dExtW_CreateTime
FROM dbo.ExtensionWorkers LEFT OUTER JOIN
(SELECT uClu_ExtWId, COUNT(DISTINCT uClu_ID) AS sl
FROM dbo.Clue
WHERE (1 = 1)
GROUP BY uClu_ExtWId) AS hd ON hd.uClu_ExtWId = dbo.ExtensionWorkers.uExtW_ID LEFT OUTER JOIN
(SELECT Clue_4.uClu_ExtWId, COUNT(DISTINCT T2.uTMKR_CluId) AS sl
FROM dbo.Clue AS Clue_4 INNER JOIN
(SELECT dbo.TMKRecord.cTMKR_Intention, T1.uTMKR_CluId
FROM dbo.TMKRecord INNER JOIN
(SELECT uTMKR_CluId, MAX(dTMKR_ContactTime) AS dTMKR_ContactTime
FROM dbo.TMKRecord AS TMKRecord_1
GROUP BY uTMKR_CluId) AS T1 ON T1.uTMKR_CluId = dbo.TMKRecord.uTMKR_CluId AND
T1.dTMKR_ContactTime = dbo.TMKRecord.dTMKR_ContactTime
WHERE (dbo.TMKRecord.cTMKR_Intention = '预约成功') OR
(dbo.TMKRecord.cTMKR_Intention = '已沟通未预约') OR
(dbo.TMKRecord.cTMKR_Intention = '已沟通现在不感兴趣')) AS T2 ON T2.uTMKR_CluId = Clue_4.uClu_ID
WHERE (1 = 1)
GROUP BY Clue_4.uClu_ExtWId) AS yx ON yx.uClu_ExtWId = dbo.ExtensionWorkers.uExtW_ID LEFT OUTER JOIN
(SELECT Clue_3.uClu_ExtWId, COUNT(DISTINCT T2_1.uTMKR_CluId) AS sl
FROM dbo.Clue AS Clue_3 INNER JOIN
(SELECT TMKRecord_2.cTMKR_Intention, T1_1.uTMKR_CluId
FROM dbo.TMKRecord AS TMKRecord_2 INNER JOIN
(SELECT uTMKR_CluId, MAX(dTMKR_ContactTime) AS dTMKR_ContactTime
FROM dbo.TMKRecord AS TMKRecord_1
GROUP BY uTMKR_CluId) AS T1_1 ON T1_1.uTMKR_CluId = TMKRecord_2.uTMKR_CluId AND
T1_1.dTMKR_ContactTime = TMKRecord_2.dTMKR_ContactTime
WHERE (TMKRecord_2.cTMKR_Intention = '永远别联系') OR
(TMKRecord_2.cTMKR_Intention = '未沟通')) AS T2_1 ON T2_1.uTMKR_CluId = Clue_3.uClu_ID
WHERE (1 = 1)
GROUP BY Clue_3.uClu_ExtWId) AS wx ON wx.uClu_ExtWId = dbo.ExtensionWorkers.uExtW_ID LEFT OUTER JOIN
(SELECT uClu_ExtWId, COUNT(DISTINCT uClu_ExtWId) AS sl
FROM dbo.Clue AS Clue_2
WHERE (cClu_State <> '无效、重复信息') AND (uClu_ExtWId <> '00000000-0000-0000-0000-000000000000')
GROUP BY uClu_ExtWId) AS hf ON hd.uClu_ExtWId = dbo.ExtensionWorkers.uExtW_ID LEFT OUTER JOIN
(SELECT Clue_1.uClu_ExtWId, COUNT(*) AS sl
FROM dbo.Clue AS Clue_1 INNER JOIN
(SELECT uCha_CluId
FROM dbo.Charge AS Charge_1
GROUP BY uCha_CluId) AS Charge ON Charge.uCha_CluId = Clue_1.uClu_ID
WHERE (1 = 1) AND (Clue_1.uClu_ExtWId <> '00000000-0000-0000-0000-000000000000')
GROUP BY Clue_1.uClu_ExtWId) AS bm ON hd.uClu_ExtWId = dbo.ExtensionWorkers.uExtW_ID) AS a
- 1培训机构管理系统优势有哪些
- 2做让客户放心的软件,适合客户的软件
- 3更新招生显示信息
- 4更新部分功能
- 5公司今年推出云主机服务。
- 6ERP应用:向云计算方向发展是大势所趋
- 7了解软件开发流程
- 8少儿英语培训暑期“发烧”
- 9为什么越来越多的培训学校选择定做软件,
- 10增加积分备注 奖学金卡能功能
- 11能不能先做个软件样子看看,然后再给钱?
- 12更新搜索功能
- 13ERP应用成功的标志
- 14客户购买软件前注意什么?
- 15培训学校有代码保障,解决以后升级的所有问题
- 16账务部的功能
- 17培训学校管理软件开发工具和环境部署
- 18软件开发注意事项
- 19通知 各项目组注意:
- 20招聘市场销售员
- 21tout和tin 2个怎么区别
- 222012年元旦放假安排的通知
- 23更新部门不同分别单独显示
- 24更新收费
- 25中小企业如何正确选择SaaS
- 26客户定做软件需求表
- 27试用软件7月底到期
- 28客户到校分为两种
- 29更新教材入库
- 30如何走出定制软件的困境?
成都公司:成都市成华区建设南路160号1层9号
重庆公司:重庆市江北区红旗河沟华创商务大厦18楼