添加视图TGRYYJView
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.uTMKR_CluId) AS sl
FROM dbo.Clue AS Clue_3 INNER JOIN
(SELECT TMKRecord_2.cTMKR_Intention, T1.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 ON T1.uTMKR_CluId = TMKRecord_2.uTMKR_CluId AND
T1.dTMKR_ContactTime = TMKRecord_2.dTMKR_ContactTime
WHERE (TMKRecord_2.cTMKR_Intention = '无意向') OR
(TMKRecord_2.cTMKR_Intention = '异常线索')) AS T2 ON T2.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(*) 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
- 1TMK对ERP的需求一
- 2国庆节放假安排
- 3修改视图
- 4PT对ERP的开发需求
- 5用户登录 - 中青教育OA办公软件管理系统及公司介绍
- 6软件开发公司应做好软件开发工作
- 7教师节优惠版
- 8泛普软件培训管理系统价格表
- 9培训学校管理系统的选择误区
- 10更新待联系线索
- 11培训学校管理软件先试用,合适在购买
- 12销售人员应具备的心理素质
- 13学员管理包含那些内容
- 14“小”企业上ERP必读
- 152015年元旦放假通知
- 16市场部流程说明:
- 17怎么清除数据日志
- 18少儿培训解决方案
- 19假如购买了培训学校管理,学校现在已经有的学生数据要逐个的去录入吗?
- 20怎么看“济宁计算机软件开发专场招聘 招聘者求职者难"对眼"”
- 21国庆节软件优惠活动开始了
- 22近期客户定做需求
- 23培训学校管理系统能有什么帮助?
- 24西安一培训学校管理软件需求
- 25ERP应用:向云计算方向发展是大势所趋
- 26互联网大会开幕 工信部“推”云计算
- 27更新使用奖学金卡
- 28更新教材入库
- 29更新渠道
- 30培训学校-教务管理系统-学员管理信息系统
成都公司:成都市成华区建设南路160号1层9号
重庆公司:重庆市江北区红旗河沟华创商务大厦18楼