Hi Everyone,
I'm trying to use MS query via ODBC connection to pull data from one main table while joining two tables (left joins each) to enrich the data. I know that MS query wizard only supports one outer join, but from what I've read, the correct SQL code will work.
Think of it like this:
Table A has customer level detail
Table B has territory groupings
Table C has product mapping
Here's the base on what I'm trying to do:
Two Table with one left join that works looks like this-
Select TableA.Field1, TableB.Field2
From {oj TableA LEFT OUTER JOIN TableB ON TableA.Field4=TableB.Field4}
Where (TableA.Field1='x')
I would think that adding in a second left join would look like something like this:
Select TableA.Field1, TableB.Field2, TableC.Field3
From {oj TableA LEFT OUTER JOIN TableB ON TableA.Field4=TableB.Field4 AND (oj TableA LEFT OUTER JOIN TableC On TableA.Field5=TableC.Field5)}
Where (TableA.Field1='x')
Any ideas how a person would add in a second (or third, fourth, etc) Left Join/Outer Join? Since other applications (e.g., Hyperion Brio) allow for multiple outer joins, I feel like MS has to....and it's just that the wizard doesn't visually support multiple outer joins.
Thanks for the help
I'm trying to use MS query via ODBC connection to pull data from one main table while joining two tables (left joins each) to enrich the data. I know that MS query wizard only supports one outer join, but from what I've read, the correct SQL code will work.
Think of it like this:
Table A has customer level detail
Table B has territory groupings
Table C has product mapping
Here's the base on what I'm trying to do:
Two Table with one left join that works looks like this-
Select TableA.Field1, TableB.Field2
From {oj TableA LEFT OUTER JOIN TableB ON TableA.Field4=TableB.Field4}
Where (TableA.Field1='x')
I would think that adding in a second left join would look like something like this:
Select TableA.Field1, TableB.Field2, TableC.Field3
From {oj TableA LEFT OUTER JOIN TableB ON TableA.Field4=TableB.Field4 AND (oj TableA LEFT OUTER JOIN TableC On TableA.Field5=TableC.Field5)}
Where (TableA.Field1='x')
Any ideas how a person would add in a second (or third, fourth, etc) Left Join/Outer Join? Since other applications (e.g., Hyperion Brio) allow for multiple outer joins, I feel like MS has to....and it's just that the wizard doesn't visually support multiple outer joins.
Thanks for the help