| 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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vilas ShendeRank #1,114 · 1.7K reputationPosted Jun 15, 2015, 3:29 AM EDT
Manoj BhoirRank #599 · 4K reputationPosted Jun 15, 2015, 3:35 AM EDT
from TableName a cross join TableName b
where b.Id <= a.Id
group by a.Id, a.value
Avinash Vajpayee71 reputationPosted Jun 15, 2015, 3:41 AM EDT