outer joins on multiple tables

F

fred

does anyone know the syntax for doing outer joins on more
than one table ?
I want to select all USR_USERS records along with the
corresponding underlying Advertisers and Publishers
records (if any), thus:

SELECT USR.USR_KEY
FROM USR_USERS AS USR
LEFT OUTER JOIN ADV_ADVERTISERS AS ADV ON
(USR.USR_KEY=ADV.ADV_USR_KEY)
LEFT OUTER JOIN PUB_PUBLISHERS AS PUB ON
(USR.USR_KEY=PUB.PUB_USR_KEY)

But this shows a syntax error when trying to run it.
 
J

John Spencer (MVP)

Try LEFT JOIN vice LEFT OUTER JOIN. ALSO Access demands that you use
parentheses to specify the order of the joins. I would try the UNTESTED SQL below

SELECT USR.USR_KEY
FROM (USR_USERS AS USR LEFT JOIN ADV_ADVERTISERS AS ADV
ON USR.USR_KEY=ADV.ADV_USR_KEY)
LEFT JOIN PUB_PUBLISHERS AS PUB ON
USR.USR_KEY=PUB.PUB_USR_KEY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top