【问题标题】:"join expression not supported" in AccessAccess 中的“不支持连接表达式”
【发布时间】:2013-05-17 11:50:55
【问题描述】:

我正在编写一个带有内部连接的 SQL 查询

select * from (table1 inner join table2 on table1.city = table2.code)
   inner join table3 on table3.col1 = 5 and table3.col2 = 'Hello'

这给了我错误“不支持连接表达式”。

但是,如果我像这样更改查询,则没有错误

select * from (table1 inner join table2 on table1.city = table2.code)
   inner join table3 on table3.col1 = [SomeColumn] and table3.col2 = [SomeColumn]

为什么 Access 在第一次查询时给我一个错误?

【问题讨论】:

    标签: ms-access ms-access-2007


    【解决方案1】:

    很晚了,但我在 MS Access 上遇到了类似的 JOIN 表达式问题,就像描述的 here Access 有时需要查询的 ON 部分内的所有内容都在括号内,即:

    SELECT ... JOIN <table> ON (everything here inside the parenthesis) WHERE ...

    【讨论】:

    • 这个!!谢谢。
    • 这是真正的答案。
    • 聚会迟到了,但这应该是公认的解决方案。
    • 如果这仍然不起作用?一直告诉我它仍然不受支持。
    【解决方案2】:

    为什么 Access 在第一次查询时给我一个错误?

    好吧,就像错误消息所说的那样,不支持这种形式的 JOIN 表达式。

    您可能想尝试以下方法:

    SELECT * FROM table1, table2, table3 
    WHERE table1.city=table2.code AND table3.col1=5 AND table3.col2='Hello'
    

    【讨论】:

    • 嗯,这是一个替代解决方案,而不是使用连接,如果有更多的表将无济于事,但在这种情况下工作,谢谢
    猜你喜欢
    • 2017-04-12
    • 2010-10-13
    • 2018-05-22
    • 1970-01-01
    • 2014-08-11
    • 1970-01-01
    • 2012-01-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多