Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to do the SELECT?
Hi
You have to use an outer-join
try this:
select *
from temp a, temp b
where a.col1 = b.col1(+)
The (+) initiates the outer-join. That meens to oracle: Show all entries from temp with the entries from temp1 and fill the entries in temp1 with nulls if nothing exists for the entry in temp.
Greeting from Switzerland
Violin schrieb:
> Hello,
> If I have 2 tables:TEMP and TEMP1
>
> TEMP TEMP1
> ----------------------- -----------------------
> COL1 char(2) COL1 char(2)
> NAME char(10) NAME1 char(20)
>
> The rows in both tables are:
> TEMP TEMP1
> ---------------------- --------------------------
> 01 AA 01 TEST
> 01 BB 02 TEST1
> 01 CC
> 02 YY
> 02 ZZ
>
> How to SELECT the result?
>
> SELECT RESULT
> -------------------------------------------------------
> 01 AA 01 TEST
> 01 BB
> 01 CC
> 02 YY 02 TEST1
> 02 ZZ
>
> Thanks in advance.
>
> Violin.
> violin.hsiao_at_mail.pouchen.com.tw
Received on Mon Nov 08 1999 - 08:40:15 CST