| id | value | sum |
| 1 | 10 | 10 |
2 | 20 | 30 |
| 3 | 30 | 60 |
| 4 | 40 | 100 |
| 5 | 50 | 150 |
initially we have two column id and value
but we want result in which third column data come
| id | value | sum |
| 1 | 10 | 10 |
2 | 20 | 30 |
| 3 | 30 | 60 |
| 4 | 40 | 100 |
| 5 | 50 | 150 |
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Avinash VajpayeePosted Jun 15, 2015, 7:41 AM
Manoj BhoirPosted Jun 15, 2015, 7:35 AM
from TableName a cross join TableName b
where b.Id <= a.Id
group by a.Id, a.value
Vilas ShendePosted Jun 15, 2015, 7:29 AM