473,499 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Left outer join problem

6 New Member
Need urgent help!

I have 3 tables that are in Left Join

ex:
select * from tbl_a
left outer join tbl_b
on tbl_b.f1 = tbl_a.f1 and tbl_b.f2 = tbl_a.f2
left outer join tbl_c
on tbl_c.f1 = tbl_a.f1 and tbl_c.f2 = tbl_a.f2 and tbl_c.f3 = tbl_a.f3 and tbl_c.f4 = tbl_a.f4

the problem is, i will only perform the left join for tbl_c.f3 and f4 to tbl_a.f3 and f4 respectively if tbl_a will have a result.

Please help.

Regards
Sep 13 '07 #1
2 2244
amitpatel66
2,367 Recognized Expert Top Contributor
Need urgent help!

I have 3 tables that are in Left Join

ex:
select * from tbl_a
left outer join tbl_b
on tbl_b.f1 = tbl_a.f1 and tbl_b.f2 = tbl_a.f2
left outer join tbl_c
on tbl_c.f1 = tbl_a.f1 and tbl_c.f2 = tbl_a.f2 and tbl_c.f3 = tbl_a.f3 and tbl_c.f4 = tbl_a.f4

the problem is, i will only perform the left join for tbl_c.f3 and f4 to tbl_a.f3 and f4 respectively if tbl_a will have a result.

Please help.

Regards
Please POST more information on what is required?
Sep 13 '07 #2
holdingbe
78 New Member
Need urgent help!

I have 3 tables that are in Left Join

ex:
select * from tbl_a
left outer join tbl_b
on tbl_b.f1 = tbl_a.f1 and tbl_b.f2 = tbl_a.f2
left outer join tbl_c
on tbl_c.f1 = tbl_a.f1 and tbl_c.f2 = tbl_a.f2 and tbl_c.f3 = tbl_a.f3 and tbl_c.f4 = tbl_a.f4

the problem is, i will only perform the left join for tbl_c.f3 and f4 to tbl_a.f3 and f4 respectively if tbl_a will have a result.

Please help.

Regards

Hi,
please understand the basic concepts of databases. when u join the tables
you must write the n-1 join conditions.. n---- no of tables ... please you mention the post what u required

regards
michael
Sep 14 '07 #3

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

Similar topics

3
10040
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
4201
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
31535
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"...
6
8997
by: Thomas Beutin | last post by:
Hi, i've a speed problem withe the following statement: SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id FROM ot_adresse AS a, ot_produkt AS p LEFT OUTER JOIN ot_kat_prod AS pz ON (...
3
23072
by: Ian Boyd | last post by:
i know nothing about DB2, but i'm sure this must be possible. i'm trying to get a client to create a view (which it turns out is called a "Logical" in DB2). The query needs a LEFT OUTER JOIN, but...
14
5665
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...
3
17820
by: Doug | last post by:
Hi, I'm more familiar with MSSQL than Access syntax and have run into a problem with correctly putting ( )'s around the joins in a 3 table query. I want to INNER JOIN lenders and accounts and...
3
49483
by: nico3334 | last post by:
I currently have a query that Joins 2 Tables (Table1 and Table2) using LEFT OUTER JOIN. Here is an example of that query: SELECT a.supply, a.state, b.cost FROM Table1 a LEFT...
1
3262
by: nico3334 | last post by:
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...
1
4585
by: teneesh | last post by:
Here I have a code for a view that has been created by a developer on my team. I am trying to use the very same code to create a view for a different formid/quesid. But I cannot figure out how this...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6892
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
5467
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
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.