Unanswered: several outer joins on the same table in access
I'm trying to outer join the same table twice ir more like that:
s.bio_url AS au_bio,
s1.bio_url AS co1_bio
FROM articles AS a
LEFT JOIN staff s ON (a.author = s.person_name)
LEFT JOIN staff s1 ON (a.author = s1.person_name)
WHERE article_section='commentary' ORDER BY article_date DESC"
and I get the following error :
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression '(a.author = s.person_name) LEFT JOIN staff s1 ON (a.author = s1.person_name)'.
you need to parenthesize two tables at a time whenever there are more than two tables in the query:
, s.bio_url as au_bio
, s1.bio_url as co1_bio
articles as a
join staff s
on a.author = s.person_name
join staff s1
on a.author = s1.person_name
where article_section = 'commentary'
by article_date desc