Joining multiple tables
Access requires parentheses to join more then two tables. In fact, in order to join
n
tables,
n-2
pairs of parentheses are needed.
select
…
from (((
table_one t1 inner join
table_two t2 on t2.one_id = t1.id ) inner join
table_three t3 on t3.two_id = t2.id ) inner join
table_four t4 on t4.three_id = t3.id ) inner join
table_five t5 on t5.four_id = t4.id
where
…
;
Outer joins
If a condition is applied to the outer-joined table, the condition must be put into parentheses:
select
…
from
table_one t1 left outer join
table_two t2 on ( t1.id = t2.id and t2.criteria = 'xyz' )