> Il 07/03/2016 11.32, Dimitry Sibiryakov s...@ibphoenix.com
> [firebird-support] ha scritto:
>> sum(saldo) over (order by data)
>
> Thank You for your response but I can't do: sum(SALDO) because SALDO is
> not a field of my table.
>
> I badly explained myself: I have a table with only this fields:
>
> DATA     DOCUMENTO_ID   NUMERO   SERIE  CARICO   SCARICO
>
>
> I need add SALDO fields in the result of the query to get a progressive
> sum of CARICO - SCARICO.

Although not that flexible as an ad-hoc query, but perhaps your 
particular use case can be achieved with a selectable stored procedure ...

I'm not good in writing PSQL out of my mind at the moment, but execute 
your SQL (without the SUM aggregate field) in a stored procedure, 
iterate over the result set, remember the computation for the previous 
row in a local variable and use that for the addition with the current 
row and call SUSPEND for each result set iteration.



-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-dig...@yahoogroups.com 
    firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

            • ... 'Thomas Steinmaurer' t...@iblogmanager.com [firebird-support]
              • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
              • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
              • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
              • ... Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
              • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
              • ... Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
              • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
              • ... Lester Caine les...@lsces.co.uk [firebird-support]
              • ... 'Carlos H. Cantu' lis...@warmboot.com.br [firebird-support]
      • Re:... Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
        • ... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
        • ... Luigi Siciliano luigi...@tiscalinet.it [firebird-support]
          • ... r...@graficalc.nl [firebird-support]
            • ... Luigi Siciliano luigi...@tiscalinet.it [firebird-support]
              • ... Rik van Kekem r...@graficalc.nl [firebird-support]
    • Re: [fi... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
  • Re: [firebir... setysvar setys...@gmail.com [firebird-support]
    • Re: [fi... Luigi Siciliano luigi...@tiscalinet.it [firebird-support]

Reply via email to