paul_van_eeren has asked for the wisdom of the Perl Monks concerning the following question:
from this output i'm trying to find a summary of 2 rows with `cost` field. In `side` field first row should be the B, and second one should be the one, which i going next in the output right after B.id side cost ------------ 1 | A | 120 2 | B | 90 3 | C | 110 4 | C | 100 5 | B | 140 6 | A | 50 7 | C | 160 8 | B | 120 9 | A | 110
eg. B = 90 and next from the row(C) = 110, so sum should be 200. then next B = 140, and next row(A) = 50. sum = 190 and last B = 120, A = 110. sum = 230.
If someone will help me with this, it will be really appreciated. Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: summary of the numbers in some sequence
by AnomalousMonk (Archbishop) on Jun 21, 2011 at 22:55 UTC | |
by paul_van_eeren (Initiate) on Jun 22, 2011 at 12:37 UTC | |
|
Re: summary of the numbers in some sequence
by toolic (Bishop) on Jun 22, 2011 at 00:35 UTC |