473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 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 3256
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

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

Similar topics

3
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def,...
1
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
7
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
3
by: Martin | last post by:
Hello everybody, I have the following question. As a join clause on Oracle we use " table1.field1 = table2.field1 (+) " On SQL Server we use " table1.field1 *= table2.field1 " Does DB2...
14
by: mike | last post by:
I'm using postgresl 7.3.2 and have a query that executes very slowly. There are 2 tables: Item and LogEvent. ItemID (an int4) is the primary key of Item, and is also a field in LogEvent. Some...
0
by: SKB | last post by:
Hi, I want to implement the "outer join" functionality in Java. Can somebody explain the pseudo code for the same. OR what needs to be done to extend the hash-join Java code of equijoin(I have the...
1
by: new2php | last post by:
Hi,I'm new to PHP...I currently doing a PHP project....I don't understand this code..can someone please kindly explain to me..Thanks select * from category c left join category2 c2 on...
2
BeemerBiker
by: BeemerBiker | last post by:
I thought the following would work, but I thought wrong: SELECT DISTINCT AvailableCourses.* FROM AvailableCourses INNER JOIN PlannedCourses ON PlannedCourses.CourseID<>AvailableCourses.CourseID...
0
by: CatchSandeepVaid | last post by:
Product and ProductBasic has one-to-one relationship Product ---> ProductID <<PK>> ProductBasic ----> ProductId, useCode, StartTime as composite key..... this startTime's value will be known as...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.