I want to find out sum of total commission in this table by worker id
show record like this
| workerid | branchid | rankid | totalcommission |
| 3 | 4 | 12 | 45. |
| 9 | 4 | 1 | 269.00 |
| workerid | branchid | rankid | totalcommission |
| 3 | 4 | 12 | 45. |
| 9 | 4 | 1 | 269.00 |
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.
Jignesh TrivediPosted Jun 3, 2013, 3:43 AM
hi,
here i have some query...
you want to sum of Total Commission by Worker Id wise Or
Worker Id, RankId, BranchId wise?
Try following Query it give you a sum of Total Commission by Worker Id, RankId, BranchId wise
SELECT workerid, branchid, Rankid, SUM(TotalCommission)
FROM #tablename> GROUP BY workerid,branchid, Rankid
hope this will help you.
Sunny SharmaPosted Jun 2, 2013, 10:46 PM
Use this query:
SELECT workerid, MAX(branchid), MAX(rankid), SUM(TotalCommission) FROM
Hope it helps :)
Please accept this as answer if it helps.
Thanks.