“join expression not supported” in Access

戏子无情 提交于 2019-11-27 08:02:15

问题


I am writing a SQL query with inner join as this

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

This giving me the error "Join expression not supported".

However, if I change the query like this then there is no error

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

Why is Access giving me an error on the first query?


回答1:


Why is Access giving me an error on the first query?

Well, like the error message says, that form of a JOIN expression is not supported.

You might want to try the following:

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



回答2:


Very late but I had a similar problem with JOIN expressions on MS Access, like described here Access sometimes needs everything inside the ON part of the query to be inside parenthesis, ie:

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



来源:https://stackoverflow.com/questions/16608313/join-expression-not-supported-in-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!