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: Thomas Schwickert <thomas.schwickert_at_itellium.com>
Date: 2000/05/30
Message-ID: <8h035f$uog$1@nnrp1.deja.com>#1/1

Hi,

> Can someone explain "Inner Join" and "Outer Join"?
> <p>Thanks in advance

suppose 2 Tables tab1 and tab2, each with one column ct1/ct2 Tab1 Tab2
ct1 ct2
a

b       b
c       c
d       d
        e


An inner join:
select ct1,ct2 from tab1,tab2 where tab1=tab2 results in
ct1 ct2



b b
c c
d d
Just paired values

A left outer join:

select ct1,ct2 from tab1,tab2 where ct1=ct2(+); results in
Ct1 Ct2



a NULL
b b
c c
d d

The (+) stand for pairs, where in tab1 is a value, but none in tab2.

A right outer join is vice versa.

In DB2 (not in Oracle, I suppose) you also have an FULL OUTER JOIN, which would result in

Ct1 Ct2



a NULL
b b
c c
d d
NULL e

Hope that helps
Bye
 Thomas

--
Thomas Schwickert               Phone: +49 69 - 404 8661
Neckermann Versand AG           Fax:   +49 69 - 404 5561
60386 Frankfurt
Germany


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue May 30 2000 - 00:00:00 CDT

Original text of this message

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