The table has 4 columns Match, Winning_Player_ID, Losing_Player_ID, Quantity_Points_Exchanged_for_that_match. I would like to in a single query show the total number of points each player won and earned over all matches.
Here is the table
M WIN LOSE QTY
1 100 201 10
2 201 100 05
3 100 201 05
4 302 100 05
For output I would like total it in this way in a single query and cannot figure it out.
ID WIN LOSE
100 15 10
201 05 15
302 05 00
1 Answer