不能对 MS Access 查询进行 2 个连接? [英] Can't do 2 joins on an MS Access query?
问题描述
所以我检查了所有名称等是否正确,查询仅适用于一个连接,而不是两个都存在语法错误:
So I have checked all the names etc are correct, the query works with only one of the joins not both with a syntax error:
SELECT *, Invoice_Accounts.Title AS t1, Invoice_Accounts.Forename AS f1, Invoice_Accounts.Surname AS s1
FROM Invoice_Accounts
RIGHT JOIN Delivery_Points ON Invoice_Accounts.Account_No = Delivery_Points.Account_No
RIGHT JOIN Companies ON Invoice_Accounts.account_id = Companies.Company_No
这是我想运行的查询,但出现错误:
This is the query I want to run but it comes up with the error:
syntax error (missing operator)
更新:
使用:
SELECT *,
Invoice_Accounts.Title AS t1,
Invoice_Accounts.Forename AS f1,
Invoice_Accounts.Surname AS s1
FROM (Invoice_Accounts
RIGHT JOIN Delivery_Points
ON Invoice_Accounts.Account_No = Delivery_Points.Account_No)
RIGHT JOIN Companies
ON Invoice_Accounts.account_id = Companies.Company_No
获取错误不支持 JOIN 表达式"
Gets me the error "JOIN expression not supported"
推荐答案
终于找到了答案:
SELECT Invoice_Accounts.Title AS t1, Invoice_Accounts.Forename AS f1, Invoice_Accounts.Surname AS s1, *
FROM(公司右联接 Invoice_Accounts ON Companies.Company_No = Invoice_Accounts.Company_Name)
RIGHT JOIN Delivery_Points ON Invoice_Accounts.Account_No = Delivery_Points.Account_No;
这个问题源于古老的 ms-access 技术,您不能多次正确连接到同一个表!
The issue arises from ancient ms-access technologies where you can't right join to the same table more than once!
这篇关于不能对 MS Access 查询进行 2 个连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!