I am stumped and this can't be so difficult. I have a table with data from games like this:
tblGames
id, HomeId, OppId, WinTeamId, LoseTeamId
1, 3, 4, 3, 4
2, 3, 4, 3, 4
3, 6, 7, 7, 6
4, 8, 7, 7, 8
5, 8, 3, 8, 3
I have another table with the teams
tblTeams
teamId, teamName
3, "Blue"
4, "Red"
6, "Orange"
7, "Yellow"
8, "Pink"
I would like the query to show wins and losses so the results from above would be:
Name, Wins, Losses
Blue, 2, 1
Red, 0, 2
Orange, 0, 1
Yellow, 2,0
Pink, 1,1
I feel like this can't be too complicated but I cannot figure it out. Any help is greatly appreciated!