[thelist] Re: mySQL query
Tom Dell'Aringa
pixelmech at yahoo.com
Fri Jun 11 08:21:42 CDT 2004
--- r937 <rudy at r937.com> wrote:
>> Tom said
>> I need to get the team NAME from table team using the foreign key
in table games (teamAID, teamBID).
> this is what you want --
>
http://www.sitepoint.com/forums/showthread.php?p=559457&highlight=team#post559457
I think that got me in the right direction (good to see you post r
btw!). In any event - I am still stuck. I can get ONE of the team
names but I am doing something wrong, I can't get the other I get a
unique issue.
SELECT
games.gamesdate, games.a1, games.a2, games.a3, games.b1, games.b2,
games.b3,
games.teamAID, games.teamBID, a.name, b.name
FROM
games
INNER JOIN
team a ON games.teamAID = a.teamID
INNER JOIN
team b ON games.teamBID = b.teamID
I've never been good using aliases as you can probably see. Anyway,
this gives me only ONE team name in BOTH places... I can't seem to
get both team names...
Tom
=====
http://www.Pixelmech.com/ - read my latest blog posting!
http://www.crossandthrone.com/ - Eternal Life
John 3:16
More information about the thelist
mailing list