| Name | Price | Discount |
| A | 10 | 2 |
| A | 20 | 5 |
| A | 55 | 3 |
| Total | 85 | 11 |
| B | 5 | 6 |
| B | 15 | 9 |
| B | 10 | 2 |
| Total | 30 | 17 |
The above table has separate total for each user. How to calculate it in sql server and return and different dataset or a combine dataset
| Name | Price | Discount |
| A | 10 | 2 |
| A | 20 | 5 |
| A | 55 | 3 |
| Total | 85 | 11 |
| B | 5 | 6 |
| B | 15 | 9 |
| B | 10 | 2 |
| Total | 30 | 17 |
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
Khan Abrar AhmedRank #778 · 3K reputationPosted Sep 27, 2017, 3:02 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Sep 27, 2017, 2:39 AM EDT
JohnRank #2,322 · 608 reputationPosted Sep 27, 2017, 2:47 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Sep 27, 2017, 2:49 AM EDT
JohnRank #2,322 · 608 reputationPosted Sep 27, 2017, 2:54 AM EDT
JohnRank #2,322 · 608 reputationPosted Sep 27, 2017, 4:02 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Sep 27, 2017, 6:47 AM EDT