var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Query Help
I'm trying to get a query working.
My db structure is
id | home | away | home_score | away_score
where 'home' and 'away' reference primary keys in the Team table
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.
Any help would be appretiated, thanks
Last edited by rprp; 11-08-04 at 11:59.
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;
Thank you very much!
I had something similiar, but rather than "Team t1, Team t2" I was only selecting Team once. Argh, should have realized that.