472,119 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

More than 1 "LEFT OUTER JOIN"

I have a query that currently pulls data from a main table and a second table using LEFT OUTER JOIN. I know how to do make another LEFT OUTER JOIN with the main table, but I want to add another LEFT OUTER JOIN to the second table. So I want the third table to be joined through the second table, not the main table.

Here is my original code that joins the main table and the second table

SELECT t1.supply,
t2.inventory,
FROM MAIN_TABLE t1
LEFT OUTER JOIN TABLE2 t2
ON t1.supply = t2.supply

I want to add another "LEFT OUTER JOIN" that joins table2 and table3 like this:


SELECT t1.supply,
t2.inventory,
t3.description
FROM MAIN_TABLE t1
LEFT OUTER JOIN TABLE2 t2
ON t1.supply = t2.supply
LEFT OUTER JOIN TABLE3 t3
ON t2.inventory = t3.inventory

But I keep getting errors. Could someone please point me in the right direction?

Thanks!
Nov 16 '07 #1
1 3161
CyberSoftHari
487 Expert 256MB
How can you left join 3 tables with 2 different ID’s?
Point what is the error it’s showing.
Nov 17 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Martin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.