不能对 MS Access 查询进行 2 个连接? [英] Can't do 2 joins on an MS Access query?

查看:35
本文介绍了不能对 MS Access 查询进行 2 个连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我检查了所有名称等是否正确,查询仅适用于一个连接,而不是两个都存在语法错误:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆