More than 1 "LEFT OUTER JOIN"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nico3334
    New Member
    • Aug 2007
    • 28

    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!
  • CyberSoftHari
    Recognized Expert Contributor
    • Sep 2007
    • 488

    #2
    How can you left join 3 tables with 2 different ID’s?
    Point what is the error it’s showing.

    Comment

    Working...