Home » RDBMS Server » Server Administration » Outer join with 3 tables
Outer join with 3 tables [message #370970] Wed, 26 July 2000 15:24 Go to next message
Messages: 28
Registered: July 2000
Junior Member
I have 3 tables which have one common field. One is a master table and I need to merge these tables. I tried outer join with the other 2 tables but the total number of records are more than what is there in the master table.So I guess I need to have a join between the other 2 tables also . I am not able to do this as I get an error saying I can't have more than one outer join with a table. I would really appreciate if somebody can give me an idea/solution to proceed
Re: Outer join with 3 tables [message #370975 is a reply to message #370970] Thu, 27 July 2000 16:10 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
You can put the first outer join in a view, then join the 3rd table to the view. You can also replace the view entirely as follows:

select c.col_z, ab.col_x, ab.col_y
from c,
(select a.join_col, a.col_x, b.col_y
from a, b
where a.join_col= b.join_col (+)) ab
where ab.join_col = c.join_col (+);

Not too sure about all the brackets, but it works fine.
Previous Topic: Oracle Names
Next Topic: Table Definition and Data problem
Goto Forum:

Current Time: Sat Oct 24 04:51:17 CDT 2020