Re: SQLPlus: How to do Running Totals?

From: Daryl Erwin <derwin_at_mach2.wlu.ca>
Date: Mon, 12 Jul 1993 13:45:07 GMT
Message-ID: <CA20v7.9K0_at_mach1.wlu.ca>


In article <7606.2c412184_at_hayes.com> fgreene_at_hayes.com writes:
>In article <C9urDx.127_at_mach1.wlu.ca>, derwin_at_mach2.wlu.ca (Daryl Erwin) writes:
>> This seems like a trivial request, but I cant figure it out...
>> I want....
>>
>> FieldA RunTot <--- Computed Field
>> ------ ------
>> 1 1
>> 1 2
>> 2 4
>> 2 6
>>
>>
>> Is there a simple answer here?
>> What compbination of 'BREAK ON' & 'COMPUTE' do I need?
>
>
>SELECT A.FIELDA, SUM(B.FIELDA)
>FROM TABLE_ONE A, TABLE_ONE B
>WHERE B.FIELDA <= A.FIELDA
>GROUP BY A.FIELDA
>
>

Ever tried this on a couple of 100K rows? I guess there is no simple solution. Note: Solutions do exists 1) PL/SQL 2) Temporary Table 3)?????? No break on or compute answer.

Rats....

-- 
Daryl Erwin                                     Net Address: derwin_at_mach2.WLU.CA
Information Systems                             Surface Mail: P4-1, Main Campus 
Wilfrid Laurier University, Waterloo, Ontario 
Bus:(519) 884-1970 x2910                                !edisni deppart m'I pleH
Received on Mon Jul 12 1993 - 15:45:07 CEST

Original text of this message