我有一个关于如何根据员工性别找到工资歧视的问题。我有 MS Acess 2007,必须使用 SQL 查询来解决
请记住,这是在我将 3 个表连接到一个多表查询之后。在这个查询中,每当我想用例如 a 对任何列进行排序时ORDER BY Salary
,它都会给我一个错误标志,说:
Syntax error (missing operator) in query expression 'Salary'
WHERE JobClass.JobClassID = Employees.JobClassID
AND Department.DepartmentID = Employees.DepartmentID'.
我想尝试在查询中对多个列进行排序。
多表查询代码如下:
SELECT JobClass.JobClassID, JobClassName, Department.DepartmentID,
DepartmentName, LastName, FirstName, Title, Sex, Years, Salary
FROM JobClass, Employees, Department
ORDER BY 'Salary'
WHERE JobClass.JobClassID = Employees.JobClassID AND Department.DepartmentID = Employees.DepartmentID;