Add a column with cumulative values
Add a column with cumulative values
Hi all,
Is there a way to add column with cumulative values? For example,
I have a table:
id | product | price
---------------
1 | camera | 200
2 | watch | 100
3 | pencil | 20
4 | wallet | 10
I want to add an extra column and make the table like this:
id | product | price | cumulative price |
--------------------------------
1 | camera | 200 | 200 |
2 | watch | 100 | 300 |
3 | pencil | 20 | 320 |
4 | wallet | 10 | 330 |
Is there a way to add column with cumulative values? For example,
I have a table:
id | product | price
---------------
1 | camera | 200
2 | watch | 100
3 | pencil | 20
4 | wallet | 10
I want to add an extra column and make the table like this:
id | product | price | cumulative price |
--------------------------------
1 | camera | 200 | 200 |
2 | watch | 100 | 300 |
3 | pencil | 20 | 320 |
4 | wallet | 10 | 330 |
This discussion has been closed.