Re: SQLPlus: How to do Running Totals?

From: <fgreene_at_hayes.com>
Date: 12 Jul 93 08:32:04 EDT
Message-ID: <7606.2c412184_at_hayes.com>


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?
> --
> 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

SELECT A.FIELDA, SUM(B.FIELDA)
FROM TABLE_ONE A, TABLE_ONE B
WHERE B.FIELDA <= A.FIELDA
GROUP BY A.FIELDA


 | Frank Greene DELPHI SYSTEMS Inc    |          _/_/_/  _/_/_/             |
 | Telephone [615] 458-6032           |           _/_/    _/_/              |
 | Internet 74200.427_at_compuserve.com  |          _/_/    _/_/  _/_/_/       |
 | Compuserve 74200,427               |         _/_/    _/_/    _/_/        |
 | 324 Ootsima Way                    |        _/_/    _/_/    _/_/         |
 | Loudon, TN 37774                   |       _/_/_/  _/_/_/  _/_/_/        |
 ----------------------------------------------------------------------------
 |         Of course, any opinions or suggestions are strictly my own       |
 ----------------------------------------------------------------------------
Received on Mon Jul 12 1993 - 14:32:04 CEST

Original text of this message