cancel
Showing results for 
Search instead for 
Did you mean: 

Question on SQl script

former_member597564
Participant
0 Kudos

I have a table with columns a and b

Column a contains values 1,2,3,4

Expected output in column b is

1,3,6,10

How to achieve this via hana sql

KonradZaleski
Active Contributor
0 Kudos

What is the correlation between current 1,2,3,4 value and expected 1,3,6,10 ? Can you explain the logic more detailed?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Nagendra,

To calculate the running total, use an OVER clause and adds the column which you want to calculate the running total for..

Select a, sum(a) over (order by a) as b from tablename

Thanks

Dinesh

Answers (0)