title: Showing names instead of IDs in a join
body: <p>I am trying to do a join and I cannot get to display what i want.</p>
  
  <p>This is my current code.</p>
  
  <pre><code>SELECT
     Tournaments.TourneyDate, 
     Tournaments.TourneyLocation, 
     Tourney_Matches.OddLaneTeamID, 
     Tourney_Matches.EvenLaneTeamID
  FROM
     Tournaments
  INNER JOIN Tourney_Matches ON (Tournaments.TourneyID = Tourney_Matches.TourneyID);
  </code></pre>
  
  <p>This outputs Dates, Location, OddLaneIDs, and EvenLaneIDs.</p>
  
  <p>Instead of the last two columns putting out raw IDs I need them to display the associated team names of the IDs.</p>
  
  <p>They would have to reference to the Teams table and the column named TeamNames.</p>
  
  <p>However, I dont know how to get this select statement to properly work.</p>
  
  <pre><code>SELECT
     Tournaments.TourneyDate, 
     Tournaments.TourneyLocation, 
     Teams.TeamName, 
     Teams.TeamName
  FROM
     Tournaments
  INNER JOIN Tourney_Matches ON (Tournaments.TourneyID=Tourney_Matches.TourneyID)
  INNER JOIN Teams ON (Tourney_Matches.OddLaneTeamID=Teams.TeamID 
                       OR Tourney_Matches.EvenLaneTeamID=Teams.TeamID);
  </code></pre>
  
  <p>I tried using this statement but it displays the same names in both id columns.</p>
  
  <p>This is what it is based off of.</p>
  
  <p><a href="https://i.stack.imgur.com/mIQX7.png" rel="nofollow noreferrer">https://i.stack.imgur.com/mIQX7.png</a></p>
  
  <p>and the question is - Show tournament date, tournament location, odd lane team name, and even lane team name
  for each match in tournament</p>
  
  <p>It must be done in a sub query.</p>