Re: How to create the SELECT script?

From: Alencar Guerreiro <alencar_at_myway.com.br>
Date: Fri, 14 Aug 1998 12:40:17 -0300
Message-ID: <35D45A61.A773EC8E_at_myway.com.br>


For this problem:

Select Table1.ACC_NO, Table1.ACC_NM, Sum(Table2.AMT) as Total

   From Table1, Table2 Where Table1.ACC_NO = Table2.ACC_NO    Group By ACC_NO, ACC_NM

Ok???

Alencar
guerra_at_zaz.com.br

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 Fri Aug 14 1998 - 17:40:17 CEST

Original text of this message