Joining a Table with Keys from Separate Tables

Posted By Posted by: EPM Partners on March 1, 2013

When creating custom timesheet SSRS reports, it may be required to perform many complex queries with multiple joins to retrieve the desired dataset.

We have come across a need to join a table to two separate tables using two separate keys.

See example below:

SELECT     *

FROM         table1 LEFT OUTER JOIN

table2 ON table1.ID = table2.ID LEFT OUTER JOIN

table3 ON table1.Col1 = table3.Col1 AND

table2.Col1 = table3.Col2


Blog Posted In Blog Posted In: How to
Blog Posted In 

Leave a Reply

Your email address will not be published.