
Illegal Outer Join Error - SQL Guru Needed
Quote:
>[snip]
>Select blah.blah, etc.
>FROM tblA a LEFT OUTER JOIN tblB b ON a.junk = b.junk
> LEFT OUTER JOIN tblC c ON b.junk = c.junk
> tblD d,
> tblE e
>(here's the wringer...)
>WHERE a.otherjunk = d.otherjunk AND
> a.morejunk = e.morejunk
Try this:
SELECT ....
FROM ((((tblA AS A LEFT JOIN tblB AS B ON a.junk = b.junk)
LEFT JOIN tblC AS C ON b.junk = c.junk)
INNER JOIN tblD AS D ON a.otherjunk = d.otherjunk)
INNER JOIN tblE AS E ON a.morejunk = e.morejunk)
When you mix LEFT and INNER joins, the results depend on the order in
which the joins are applied. So use the parens to avoid the 'Ambiguous
join' error message.