I have 2 tables i need to join
events
------
eventID | date
1 2019
2 2019
3 2020
results
-------
eventID | playerID | totalScore
1 1 34
2 2 35
3 1 36
I want to get a result for a selected player ID as below so it show all events and the total scores for each event that the player has played in. e.g for Player 1
eventID | totalScore
1 34
2 NULL
3 36
I'm assuming i need a left join, I have tried numerous queries e.g
SELECT events.eventID, results.totalScore, results.playerID
FROM events
LEFT OUTER JOIN results
ON events.eventID = results.eventID WHERE results.playerID=1
Most of my queries only show the actual events where selected player has a score.
I'm thinking it may be to do with the where clause but I'm unsure how to proceed.