Re: SQL Q again
Date: Mon, 13 Jul 1998 12:15:10 +0200
Message-ID: <35A9DE2E.18ED_at_ezv.admint.ch>
Jeffrey Keung wrote:
>
> I have 2 tables, Table A with column : ID and Data1 & Table B wth
> column ID and Data2
> now for example I have these data in both table:
> Table A :
> ID Data1
> -----------
> 1 A
> 2 B
> 4 C
>
> and Table B:
> ID Data2
> ------------
> 2 XX
> 3 YY
> 5 ZZ
>
> what SQL statement I should write in order to have the following output
> :
> ID Data1 Data2
> --------------------------
> 1 A
> 2 B XX
> 3 YY
> 4 C
> 5 ZZ
>
> Thank u!
select b.id, a.data1, b.data2 from a a, b b
where a.id(+) = b.id
union
select a.id, a.data1, b.data2 from a a , b b
where b.id(+) = a.id
order by 1;
try it Received on Mon Jul 13 1998 - 12:15:10 CEST
