If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Running Sum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-11, 08:13
a_tadina a_tadina is offline
Registered User
 
Join Date: Oct 2011
Posts: 1
Running Sum

How to make a running sum in a query?

Table Look like:
ID quantity
1 10
2 15
3 30


J would like that a report look's like:
ID quantity running sum
1 10 10
2 15 25
3 30 55
Reply With Quote
  #2 (permalink)  
Old 10-03-11, 11:20
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
Hi,

an excellent opportunity to write a stored procedure, that you could invoke as
select running_sum( quantity ) from yourtable
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On