Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help

Re: Help

From: L120bj <l120bj_at_aol.com>
Date: 2000/05/30
Message-ID: <20000530062821.24203.00000788@ng-fp1.aol.com>#1/1

>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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US