Reputation: 1043
I have two tables, I'll list table names and relevant fields:
PLAYERS:
playerid
STATS:
statsid
playerid
year
Every time a player accumulated stats in a game, it put a row in the stats
table and recorded the year.
Now, I would like get a list of all players in the players
table who have NOT recorded any stats in 2016 and up.
I tried LEFT JOIN but don't really understand what I'm doing and couldn't get it to work. This is one of the things I tried, don't laugh
SELECT * FROM `players` LEFT JOIN `stats` ON players.playerid = stats.playerid where count(*) = 0 and stats.year >= 2016
Upvotes: 0
Views: 23