If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Schedule
id | home | away | home_score | away_score
where 'home' and 'away' reference primary keys in the Team table
Team
id | name | city
What I would like to do, is for each game in Schedule, select the actual name's of the teams playing (instead of just there ids)
I can't figure out the JOIN involved in this.
select t1.name as "home team", t2.name as "away team", s.home_score, s.away_score
from schedule s, team t1, team t2
where s.home=t1.id and s.away=t2.id;