djhawthorn
Technical User
I have the following query:
SELECT Team1, COUNT(Winner) AS Won FROM Games WHERE Winner = -1 GROUP BY Team1
UNION ALL
SELECT Team2, COUNT(Winner) AS Won FROM Games WHERE Winner = -1 GROUP BY Team2;
Which returns the following:
I need it to merge the Team1 column though to get the following output:
Can someone help?
Cheers.
The dumber they think you are, the more surprised they'll be when you kill them!
SELECT Team1, COUNT(Winner) AS Won FROM Games WHERE Winner = -1 GROUP BY Team1
UNION ALL
SELECT Team2, COUNT(Winner) AS Won FROM Games WHERE Winner = -1 GROUP BY Team2;
Which returns the following:
Code:
+-------+-----+
| Team1 | Won |
+-------+-----+
| 1 | 1 |
| 9 | 1 |
| 4 | 1 |
| 9 | 1 |
+-------+-----+
I need it to merge the Team1 column though to get the following output:
Code:
+-------+-----+
| Team1 | Won |
+-------+-----+
| 1 | 1 |
| 9 | 2 |
| 4 | 1 |
+-------+-----+
Can someone help?
Cheers.
The dumber they think you are, the more surprised they'll be when you kill them!