Subject | Re: RunSum in Firebird |
---|---|

Author | michaeleubanks2000 |

Post date | 2008-07-30T13:23:53Z |

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:

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:

>the

> 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

> >values in the specified column in a continuous running total. TheRUNSUM

> >function is identical to the SUM function except for the fact thatit

> >does not reset itself when sub-totalling.what I

> >in my case I use RunSum(1), combined with order by I get exactly

> >need to rank my rows.total relate to your ordering criterion (Price)?

>

> So -- *what column is it totalling on* and how does the running

>

> Before you answer, please read the following article:

> http://www.catb.org/~esr/faqs/smart-questions.html

>

> ^ heLen

>