Table t:
Expand|Select|Wrap|Line Numbers
- Num Winner Loser
- 0 Fred Harry
- 1 Harry George
- 2 Fred Eric
SELECT DISTINCT Winner, COUNT(*) AS theCount FROM t GROUP BY Winner ORDER BY theCount DESC
Giving
Fred, 2
Harry 1
George 0
Eric 0
Same applies for losers also.
But I actually also want to total up Winner or Loser so that my result should be
Fred 2
Harry 2 (1 for winner, 1 for loser)
George 1
Eric 1
so this is really the sum of number of wins + number of losses
I have tried allsorts - could someone please point me in the right direction?
Thanks in advance