|
Re: inner joint [message #372158 is a reply to message #372157] |
Tue, 16 January 2001 17:32 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
Oracle only has 2 variations:
The usual join...
select x.col1, y.col2, z.col3
from table1 x, table2 y, table3 z
where x.joincol1 = y.joincol1
and y.joincol2 = z.joincol2
etc.
or the outer join...
select x.col1, y.col2, z.col3
from table1 x, table2 y, table3 z
where x.joincol1 = y.joincol1 (+)
and y.joincol2 = z.joincol2
The (+) indicates the side which the outer join is made on. In this case rows in x will be returned even if there is no corresponding row in y. The other way around it looks like:
where x.joincol1 (+) = y.joincol1
If you join more than one col between the 2 tables, each join needs the (+). i.e.
where t1.col1 = t2.col1 (+)
and t1.col2 = t2.col2 (+)
|
|
|