title: MySQL INNER JOIN Alias
body: <p>Does anyone know how I can do an inner joins and alias values within so they won't overwrite each other? It might look more clear if you see my code:</p>
  
  <pre><code>    SELECT  home, away, g.network, g.date_start 
      FROM    game g
      INNER JOIN team t ON (
          (t.importid = g.home) as home
          OR
          (t.importid = g.away) as away
      )
      ORDER BY date_start DESC 
      LIMIT 7
  </code></pre>
  
  <p><strong>SOLVED</strong> (After the help below here is my final query)</p>
  
  <pre><code>    SELECT 
          home.market AS home_market, 
          away.market AS away_market, 
          g.network, 
          g.date_start
  
      FROM game AS g
      INNER JOIN team AS home ON (
          home.importid = g.home
      )
      INNER JOIN team AS away ON (
          away.importid = g.away
      )
  
      ORDER BY g.date_start DESC 
      LIMIT 7
  </code></pre>