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!

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.