How to calculate running total in sql backwards

enter image description here

select id,date,amount,SUM (Amount)  OVER (PARTITION BY ID ORDER BY DATE desc)  AS runningbalance from sales

I have tried this to reverse running balance going from the most recent to older records. How can I reverse this to go backwards to give me running balance the other way?



from Recent Questions - Stack Overflow https://ift.tt/3FG6YSV
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept