Sum in array with match value
Posted
by user325504
on Stack Overflow
See other posts from Stack Overflow
or by user325504
Published on 2010-04-26T03:42:59Z
Indexed on
2010/04/26
3:53 UTC
Read the original article
Hit count: 267
Dear all, I would like to do a simple sum per salesid in php - mysql after cross calculation between date (2 table) to get the real time commission, all the value already come out correctly but I got problem with final sum per sales id.
salesid-commission
aa0001 - 1000
bb0001 - 500
aa0001 - 200
bb0001 - 50
I already try with few sample in this web but still cannot meet the correct result. I cannot do the sum in mysql because of some reason (need calculation with other table)
the result will be:
aa0001 - 1200
bb0001 - 550
I aprreciated for any help to complated the test. Thank you so much.
© Stack Overflow or respective owner