语法错误 - sql

时间:2017-09-20 20:24:04

标签: sql ms-access

我正在尝试用SQL编写查询但是在访问时遇到语法错误。我在网上检查了各种代码检查器,但他们都说没有问题。有人可以帮忙吗?

   SELECT
      PROJECT.ProjectID,
      PROJECT.Name,
      PROJECT.Department,
      EMPLOYEE.EmployeeNumber,
      EMPLOYEE.LastName,
      EMPLOYEE.FirstName,
      EMPLOYEE.Phone 
   FROM
     ASSIGNMENT 
     INNER JOIN
         EMPLOYEE 
         ON ASSIGNMENT.EmployeeNumber = EMPLOYEE.EmployeeNumber 
     INNER JOIN
         PROJECT 
         ON ASSIGNMENT.ProjectID = PROJECT.ProjectID;

1 个答案:

答案 0 :(得分:1)

MS Access需要多个JOIN的括号:

FROM (ASSIGNMENT INNER JOIN
      EMPLOYEE 
      ON ASSIGNMENT.EmployeeNumber = EMPLOYEE.EmployeeNumber 
     ) INNER JOIN
      PROJECT 
      ON ASSIGNMENT.ProjectID = PROJECT.ProjectID;