我有一個必須包含3個連接的查詢,但我得到這個錯誤:多加入SQL
Syntax error (Missing operator)
的SQL:
SELECT
Agents.[PF],
Agents.[User_ID],
Agents.[First_Name],
Agents.[Second_Name],
Agents.[Third_Name],
Agents.[Family_Name],
Agents.[Gender],
Agents.[Contract_Type],
Agents.Area,
Teams.Team_Name,
Agents.Hiring_Date,
Resignation_Pool.Resignation_Date,
Resignation_Pool.Effective_Date,
Replace(
IIf(Skills.Skill_Directory IS NULL, '', 'Directory, ')
+ IIf(Skills.Skill_TRC IS NULL, '', 'TRC, ')
+ IIf(Skills.Skill_Prepaid IS NULL, '', 'Prepaid, ')
+ IIf(Skills.Skill_Postpaid IS NULL, '', 'Postpaid, ')
+ IIf(Skills.Skill_KeyAccount IS NULL, '', 'KeyAccount, ')
+ IIf(Skills.Skill_Blackberry IS NULL, '', 'Blackberry, ')
+ IIf(Skills.Skill_Broadband IS NULL, '', 'Broadband, ')
+ IIf(Skills.Skill_Concierge IS NULL, '', 'Concierge, ')
+ IIf(Skills.Skill_ISP IS NULL, '', 'ISP, ')
+ IIf(Skills.Skill_Mada IS NULL, '', 'Mada, ')
+ IIf(Skills.Skill_CSCS IS NULL, '', 'CSCS, ')
+ '$', ', $', ''
) AS Skills
FROM Agents
LEFT JOIN Resignation_Pool
ON Agents.PF = Resignation_Pool.PF
LEFT JOIN Teams
ON Agents.Team = Teams.ID
LEFT JOIN Skills
ON Agents.PF = Skills.PF
WHERE Agents.Contract_Status = 'Active'
是什麼原因造成這個錯誤?
你有沒有試圖讓在選擇部分相同,減少田間的simplier例如,先做2個表的連接,然後添加第三個...建議不要將整個聲明放在一行中。 – jpee 2013-03-10 20:09:39