1

我在 MSAccess 中查询时遇到问题。代码如下所示:

SELECT CustomerId, FirstName, Surname, DateOfBirth, WorkoutId, Name, Description
   FROM Customer 
   INNER JOIN (Registration INNER JOIN TrainingProgram (INNER JOIN WorkOutPlan)) 
   ON Customer.CustomerId = Registration.CustomerId 
   ON Registration.CustomerId = TrainingProgram.CustomerId 
   ON TrainingProgram.WorkId = WorkOutPlan.WorkId
      WHERE DateOfBirth > #01/01/83#;

该数据库是为一个虚构的健身房创建的。

查询的目的是显示出生日期大于 83 年 1 月 1 日的锻炼计划成员。查询选择的信息来自 3 个表。客户、培训计划和锻炼计划。另一个表“注册”将客户表和培训计划表与“客户 ID”链接

查询产生语法错误并突出显示括号“”(“INNER JOIN WorkOutPlan))”。我看不到代码有任何问题,但也许我在此过程中犯了一个错误?

您的帮助将不胜感激。

4

1 回答 1

3

支架正确

SELECT CustomerId, FirstName, Surname, DateOfBirth, WorkoutId, Name, Description
FROM (Customer 
INNER JOIN (Registration
            INNER JOIN (TrainingProgram
                        INNER JOIN WorkOutPlan 
                                   ON Customer.CustomerId = Registration.CustomerId )
                        ON Registration.CustomerId = TrainingProgram.CustomerId )
            ON TrainingProgram.WorkId = WorkOutPlan.WorkId)
WHERE DateOfBirth > #01/01/83#;
于 2013-04-24T10:15:08.893 回答