I have sql server databse with two tables, teams and games. Each game has a predicted_winner column and a winner column. both columns reference the team table id field. I want to query the database and get a count of how many games the team was predicted to win, and how many they actually won. However based on my query it is only returning a count of the predicted_winner or the winner, whichever column I join the team table on. how do I get accurate counts of both columns.
This is my incorrect query
SELECT teams.id, count(predicted_Winner), count(winner)
FROM teams left join games on teams.id=games.predicted_winner
GROUP BY teams.id