Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to create the SELECT script?
select t1.acc_no, t1.acc_nm, t2.amt
from table1 t1, table2 t2
where t1.acc_no = t2.acc_no;
On Wed, 12 Aug 1998 08:59:41 GMT,
violin.hsiao_at_mail.pouchen.com.tw (Violin) wrote:
>Hello,
>I have a select problem,I hope someone could help me!
>
>There are 2 tables:TABLE1 is master,TABLE2 is detail.
>And the data is:
>
>TABLE1:
>ACC_NO ACC_NM
>---------------------------------
>10 Training cost
>20 Traffic cost
>30 Medical cost
>40 Sale cost
>50 Manage cost
>60 Telecom cost
>
>TABLE2:
>ACC_DATE ACC_NO AMT
>--------------------------------------------
>960101 10 100
>960101 20 200
>960103 30 5000
>960105 10 400
>960109 50 1000
>
>How could I do for the result:
>ACC_NO ACC_NM TOTAL
>---------------------------------------------------
>10 Training cost 500
>20 Traffic cost 200
>30 Medical cost 5000
>40 Sale cost
>50 Manage cost 1000
>60 Telecom cost
>
>Please give me some suggestions for the select statement,
>I'll very appriciate for your help!
>Please Cc to : violin.hsiao_at_mail.pouchen.com.tw,Thank you so much :)
Received on Thu Aug 13 1998 - 21:52:31 CDT