Put simply, I'm getting one single row all columns NULL. I should not get a row at all.
I'm trying to get the next "round" in a competition. I'm joining it to a roundgames table which lists all the games for each round in it. I then join that also to the games table.
I'm then getting the kickoff time greater than now.
There's isn't a round with games in the future so I should return an empty row but I'm getting one with NULL in each column.
Why?
SELECT r.*, MIN(g.gameId) FROM `rounds` r
JOIN `roundgames` rg ON r.roundId = rg.roundId
JOIN `games` g ON rg.gameId = g.gameId
WHERE `competitionId` = 65 AND g.kickOff > now()