Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Problem with Joins

Author  Topic 

rsundar
Starting Member

1 Post

Posted - 2008-03-12 : 12:23:32
Hi,

I am debugging a procedure that has multiple joins. The problem i find is one table doesnt have a value that is needed to display the required result. I cannot change the joins coz data comes from that table only.

How would i resolve this issue? In the code below, columns b2 and c4 from table2 and Table3 match but the column a1 from TableA doesnt match and i found that it did not exist.
How to interchange the joins so that the result set includes the column b2 and c4?

Eg:

Select * from Table1 A

Join Table2 B on
A.a1 = b.b2

left join on Table 3 C
on
A.a1 = C.c4

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-12 : 12:29:27
Try
Select * from Table1 A

right outer Join Table2 B on
A.a1 = b.b2

right outer join on Table 3 C
on
A.a1 = C.c4
Go to Top of Page
   

- Advertisement -