Quote:
|
Originally Posted by Pat Phelan
The MS-Access GUI generates more parenteses than a LISP program, but Jet hasn't needed them for at least a couple of years.
|
as i said, maybe a very recent version of access has dropped this requirement but it is still necessary in Access 2000
create these three tables in access:
pat1
id descr
1 foo
2 bar
3 qux
pat2
id descr
1 one
2 two
3 three
pat1pat2
pat1id pat2id
1 2
1 3
2 1
2 3
3 1
3 2
3 3
then try running this query:
Code:
select pat1.descr as pat1descr
, pat2.descr as pat2descr
from pat1
inner
join pat1pat2
on pat1.id = pat1pat2.pat1id
inner
join pat2
on pat1pat2.pat2id = pat2.id
syntax error (missing operator) in query expression
however, if you add the parentheses:
Code:
select pat1.descr as pat1descr
, pat2.descr as pat2descr
from (
pat1
inner
join pat1pat2
on pat1.id = pat1pat2.pat1id
)
inner
join pat2
on pat1pat2.pat2id = pat2.id
then tada, nice results:
pat1descr pat2descr
foo two
foo three
bar one
bar three
qux one
qux two
qux three
explanation? parentheses
are required for multiple joins!!!
