I have two tables, games and teams. In the games table I have team1 and team2 which are referencing the teams table to get the name of the team.
I always get a empty set returned.
My query:
Code:
SELECT g.team1, g.team2, t.team FROM games g JOIN teams t ON (g.team1 = t.id AND g.team2 = t.id);
if I leave out the AND g.team2 = t.id I can get the first team name but I can't figure out how to get the second name.