Subject Re: [firebird-support] RunSum in Firebird
Author Alexandre Benson Smith
Halim B wrote:
> I am trying to sort my table based on a field then add another field to
> represent the rank(row number within the table).
> I used to use RunSum function which does not exist in Firebird.
> Select ItemDescription, Price, RunSum(1) as Rank from ItemsSales Order
> by Price Desc
> This query will give me the list of my products and the sale price in
> order. The order is made through the "RANK" field. I need the rank
> because my result is going on a report.
> What is the easiest way to do this in Firebird?
> Thank you,
> -Halim

Do it on the report...

If you really really want to do it on server side use a stored procedure

see you !

Alexandre Benson Smith
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil