監(jiān)理公司管理系統(tǒng) | 工程企業(yè)管理系統(tǒng) | OA系統(tǒng) | ERP系統(tǒng) | 造價咨詢管理系統(tǒng) | 工程設(shè)計管理系統(tǒng) | 甲方項目管理系統(tǒng) | 簽約案例 | 客戶案例 | 在線試用
X 關(guān)閉

未到訪學(xué)生語句修改代碼

申請免費試用、咨詢電話:400-8352-114

    

SELECT     dbo.Clue.uClu_ID, dbo.Clue.cClu_CName, dbo.Clue.iClu_Age AS 年齡, dbo.Clue.cClu_Phone, TMKRecord.cTMKR_Intention AS 意向狀態(tài), TMKRecord.dTMKR_ContactTime AS 上次聯(lián)系時間,

                      TMKRecord.cUser_Name AS TMK, dbo.Clue.dClu_CreateTime, dbo.Channel.cCha_Name AS 渠道, dbo.Clue.cClu_HFRY, dbo.ExtensionWorkers.cExtW_Num AS 推廣人員, dbo.Clue.cClu_KCGW,

                      dbo.Clue.dClu_DFZTChangeTime AS 到訪狀態(tài)更改時間, dbo.Clue.cClu_State

FROM         dbo.Clue LEFT OUTER JOIN

                      dbo.StudentBelongs ON dbo.StudentBelongs.uStuB_ID = dbo.Clue.uClu_StuBId LEFT OUTER JOIN

                      dbo.Grade ON dbo.Grade.uGra_ID = dbo.Clue.uClu_GraId LEFT OUTER JOIN

                      dbo.ExtensionWorkers ON dbo.ExtensionWorkers.uExtW_ID = dbo.Clue.uClu_ExtWId LEFT OUTER JOIN

                      dbo.TSource ON dbo.TSource.uTS_ID = dbo.Clue.uClu_TOUTId LEFT OUTER JOIN

                      dbo.Channel ON dbo.Channel.uCha_ID = dbo.Clue.uClu_ChaId LEFT OUTER JOIN

                          (SELECT     TMKRecord_1.uTMKR_CluId, MAX(TMKRecord_1.cTMKR_Intention) AS cTMKR_Intention, MAX(TMKRecord_1.dTMKR_ContactTime) AS dTMKR_ContactTime, COUNT(*) AS TMKCount,

                                                   MAX(dbo.[User].cUser_Name) AS cUser_Name

                            FROM          dbo.TMKRecord AS TMKRecord_1 LEFT OUTER JOIN

                                                   dbo.[User] ON TMKRecord_1.uTMKR_TMKId = dbo.[User].uUser_ID

                            GROUP BY TMKRecord_1.uTMKR_CluId) AS TMKRecord ON TMKRecord.uTMKR_CluId = dbo.Clue.uClu_ID

WHERE     (dbo.Clue.cClu_State <> '未到訪')

 

發(fā)布:2007-03-30 10:26    編輯:泛普軟件 · xiaona    [打印此頁]    [關(guān)閉]