Sunday, 15 January 2012

substracting values for previous months in oracle -


I have a table -

  middle period total amount new total amount 123 01 45566 Total amount i.e. 45566 123 02-5677 Total amount one ???? (Total amount for 01 months) 123 03 7899 Total amount one ???? (Total amount for 01 month total amount 02 + 02 month) 235 01 5677 Total amount i.e. 5677 235 02 768878 Total amount (total amount for 01 months) i.e. 768878 C (5677) 235 03 -676787   

How do I write a question to get the new total amount in the column.

  total_anam - nvl (amount (total_america ) Over (according to the rows of the period between the intermediate preceding and 1 preceding by the middle order), 0)    

No comments:

Post a Comment