Re: How to create the procedure???

From: The Baker <walch_at_bigfoot.com>
Date: 10 Aug 1998 14:19:19 GMT
Message-ID: <01bdc46c$00904990$9c02d180_at_f8889154>


Try this request :

select date, acc_no, sum(decode(DC,'D',amt,0)) D_amt, sum(decode(DC,'C',amt,0)) C_amt
from accd
group by date, acc_no
order date

Violin <violin.hsiao_at_mail.pouchen.com.tw> wrote in article <35cfb65b.11722580_at_news.twsc.pouchen.com.tw>...
> Hello,
> I have a table named "ACCD" and data:
> DATE ACC_NO DC AMT
> ----------- --------------- ----- ---------
> 961004 111101 D 1540
> 961003 111105 D 3068
> 961004 111101 C 992
> 961004 111106 D 5300
> 961002 111101 D 935
> 961007 111104 D 7752
> 961009 111101 D 2172
> 961003 111102 C 8493
> 961008 111101 C 318
> 961007 111104 C 468
> 961006 111101 C 660
> 961005 111103 C 995
> 961009 111102 D 665
> 961008 111102 C 25949
>
> I want to create a procedure with pass in
> start-of-date and end-of-date,
> then response sort by DATE,group by ACC_NO,each ACC_NO counts
> sum(D_AMT) where DC='D',sum(C_AMT) where DC='C'
>
> like this:
> DATE ACC_NO D_ AMT C_AMT
> ----------- --------------- ------------- -----------
> 961002 111101 935 0
> 961003 111102 0 8493
> 961003 111105 3068 0
> 961004 111101 1540 992
> 961004 111106 5300 0
> 961005 111103 0 995
> 961006 111101 0 660
> 961007 111104 7752 468
> ::::::::::::
>
> REALLY NEED HELP!!
> How could I do with this???
> Please give me some suggestion,Thank you billions!
> Please Cc to : violin.hsiao_at_mail.pouchen.com.tw,Thank you :)
>
Received on Mon Aug 10 1998 - 16:19:19 CEST

Original text of this message