Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help
>Can someone explain "Inner Join" and "Outer Join"?
>
>Thanks in advance
>
An inner join is when the only rows returned are those that match on a
particular key value,
e.g.
select A.col_a, B.col_b
from tableA A,
tableB B
where a.col_a = B.col_a;
will only return rows from tableA where there is a row in tableB with the same value for col_a.
An outer join returns a row from the table you specify, using (+) in the where
clause, regardless of whether a matching row exists in the table being joined
to.
i.e.
select A.col_a, B.col_b
from tableA A,
tableB B
where a.col_a (+) = B.col_a;
Will return all rows from tableA, with the second column selected being null
for rows in tableA that do not have corresponding rows in tableB.
HTH,
Rob
Received on Tue May 30 2000 - 00:00:00 CDT