Subject | Re: [firebird-support] Re: 2 inner joins on the same table |
---|---|
Author | Dan Wilson |
Post date | 2005-03-09T18:09:14Z |
On 3/9/2005 at 5:55 PM Ricardo wrote:
assume table Match has two fields: team1 and team2, which are foreign key references to id in Team
select team1, team2, t1.name, t2.name from Match
inner join Team t1 on team1 = t1.id
inner join Team t2 on team2 = t2.id;
Is that what you want to do?
HTH,
Dan.
> I have a table Match in which each match has two teams. The teams areassume table Team has two fields: id and name
> stored on the Team table. When I get one match, I need to get the
> names of both teams.
>
assume table Match has two fields: team1 and team2, which are foreign key references to id in Team
select team1, team2, t1.name, t2.name from Match
inner join Team t1 on team1 = t1.id
inner join Team t2 on team2 = t2.id;
Is that what you want to do?
HTH,
Dan.