Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to write SQL statement.
Hello Aung,
I'm not sure if you want as you dont explain much,
but a group by query like this one might do it:
select A.col1,sum(A.col2),sum(B.col3)
from A, B
where A.col1 = B.col1
and A.col2 = B.col2
group by A.col1
/
Good luck !
Aung Aung > heeft geschreven in bericht
>Hello,
>
>I have one problem to retrieve data in one statement. It is as follows:
>Table A. col1 col2 col3
> A X 100
> A Y 200
> B X 100
>
>Table B. A X 10
> A X 20
> A Y 10
> A Y 20
> B X 50
>
>I would like to have the result as
> A 300 60 (A,300 from Table A, 60 from Table B)
> B 100 50 (B,100 from Table A, 50 from Table B)
>
>Thank you,
>Aung.
Received on Mon Sep 14 1998 - 06:38:30 CDT