0

I have an Oracle db and a table and I'd want to sum the VAL column until I have the value in column SUMM 100 and the difference in column DIF - as in this example:

ID VAL  SUMM    DIF
1   40  40      0
2   20  60      0
3   30  90      0
4   15  100     5
5   22  0       27

How can I do this? Thanks!

2
  • 1
    How is diff calculated? The summ column is easy: sum(val) over (order by id)
    – user1822
    Commented Nov 16, 2015 at 14:42
  • from the the difference afther the summ reach 100
    – WDrgn
    Commented Nov 16, 2015 at 14:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.