469,623 Members | 1,850 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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 3040
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
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.