Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL statement question...
Homework, definitely. But anyway...
select aaa.*, bbb.*
from aaa, bbb
where bbb.a1(+) = aaa.a1;
and that's all.
Hth,
--
Sybrand Bakker, Oracle DBA
Jimmy <c6635500_at_comp.polyu.edu.hk> wrote in message
news:38190B96.67042BBD_at_comp.polyu.edu.hk...
> Hello all,
>
> Table AAA:
> A1 number(10);
> A2 varchar2(10);
> A3 date;
>
> A1 A2 A3
> ----- ----- ------
> 1 A1 01-Jan-90
> 2 A2 02-Jan-90
>
> Table BBB
> B1 number(10);
> A1 number(10);
> B2 varchar2(100);
>
> B1 A1 B2
> ----- ----- ------
> 1 1 B1
> 2 3 B2
>
> Results:
> A1 A2 A3 B1 B2
> ----- ------ ------------ ----- ----
> 1 A1 01-Jan-90 1 B1
> 2 A2 02-Jan-90
> 3 2 B2
>
> How can I get the results by using one SQL statement? (i.e. retrieve
> all the fields of table AAA and BBB, join by A1. Also show the record
> content if the record is found in one table only)
>
> Thanks.
> Jimmy
>
>
Received on Thu Oct 28 1999 - 08:01:31 CDT