我被要求为数据库创建查询,查询是创建: 显示FirstName,LastName,Email和Grade(文本标题)的员工列表,其中包含“视频”一词的技能(即使员工拥有多种视频技能,每位员工也只有一个条目)
到目前为止,我已经这样做了:
SELECT Employee.FirstName, Employee.LastName, Employee.Email, Grade.Title,
FROM Employee INNER JOIN
Grade
ON Grade.GradeID = Employee.GradeID INNER JOIN
EmployeeSkill
ON EmployeeSkill.EmployeeID = Employee.EmployeeID INNER JOIN
Skill
ON Skill.SkillID = EmployeeSkill.SkillID
WHERE Skill.Title LIKE "%video%"
但是我一直收到1064错误,我不确定我做错了什么,请帮忙。
答案 0 :(得分:1)
在查询的SELECT部分中有一个额外的逗号
SELECT Employee.FirstName,
Employee.LastName,
Employee.Email,
Grade.Title, -- Remove the comma here
FROM Employee
INNER JOIN Grade
ON Grade.GradeID = Employee.GradeID
INNER JOIN EmployeeSkill
ON EmployeeSkill.EmployeeID = Employee.EmployeeID
INNER JOIN Skill
ON Skill.SkillID = EmployeeSkill.SkillID
WHERE Skill.Title LIKE "%video%"