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!