Reputation: 251
I am trying to left inner join 5 tables. I SELECT 4 columns, then I wrote
FROM table_a
LEFT INNER JOIN table_b
LEFT INNER JOIN table_c
LEFT INNER JOIN table_d
ON table_a.a = table_b.a,
table_b.c=table_c.c,
table_c.b=table_d.b
But when I try to run this on SQL in Access 2007, it tells me there is an error in the FROM code. I have really no idea what I am doing wrong.
Thanks for any help you can give me.
Upvotes: 1
Views: 511
Reputation: 1269973
MS Access requires parentheses around joins:
FROM ((table_a LEFT JOIN
table_b
ON table_a.a = table_b.a
) LEFT INNER JOIN
table_c
ON table_b.c = table_c.c
) LEFT JOIN
table_d
ON table_c.b = table_d.b
If you intend INNER JOIN
then replace LEFT JOIN
with INNER JOIN
.
In addition:
LEFT INNER JOIN
.LEFT JOIN
for a left outer join.ON
clause immediately after the table/subquery after the JOIN
.Upvotes: 3