Subject Re: RunSum in Firebird
Author michaeleubanks2000
I believe Halim is refering to the RUNSUM function found in
Elevatesoft DBISAM Database Engine:

RUNSUM Function

The RUNSUM function calculates the sum of values for a column in a
running total. The syntax is as follows:

RUNSUM(column_reference or expression)

Use RUNSUM to sum all the values in the specified column in a
continuous running total. The RUNSUM function is identical to the SUM
function except for the fact that it does not reset itself when sub-
totalling.

If a query is ordered by price, RUNSUM(1) would provide a column that
would sequentially number each row starting with 1 for the first row,
2 for second, therefore providing a "rank" for your results (by price
in the example).

Michael

Michael



--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
>
> At 11:21 AM 30/07/2008, you wrote:
> >The RUNSUM function calculates the sum of values for a column in a
> >running total. The syntax is as follows:
> >RUNSUM(column_reference or expression. We used RUNSUM to sum all
the
> >values in the specified column in a continuous running total. The
RUNSUM
> >function is identical to the SUM function except for the fact that
it
> >does not reset itself when sub-totalling.
> >in my case I use RunSum(1), combined with order by I get exactly
what I
> >need to rank my rows.
>
> So -- *what column is it totalling on* and how does the running
total relate to your ordering criterion (Price)?
>
> Before you answer, please read the following article:
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> ^ heLen
>