mvwmail
asked on
SQL Query
Hopefully a simple one, thouhg I am too knackered to work it out (lazy oik)
I have a MATCH table which has a home team and an away team
MatchID (PK)
HomeTeam
AwayTeam
Both the Home and Away team pull off the team from the same table of teams
TEAMS
TeamID (PK)
TeamName
There is more information but it is not important.
I know how to code a simple SELECT staement using a JOIN to pull of the name of ONE of the teams, but have never done it for TWO.. any help appreicated.
Thanks
I have a MATCH table which has a home team and an away team
MatchID (PK)
HomeTeam
AwayTeam
Both the Home and Away team pull off the team from the same table of teams
TEAMS
TeamID (PK)
TeamName
There is more information but it is not important.
I know how to code a simple SELECT staement using a JOIN to pull of the name of ONE of the teams, but have never done it for TWO.. any help appreicated.
Thanks
ASKER
My app does not like that at ALL, throws a wobbler.. and I cant work throuhg it enouhg to debug. Dont know if it makes a difference but my database is Access.
Will have another go in a bit.. need coffee
Will have another go in a bit.. need coffee
I don't know then. I don't have enough experience with Access and Coldfusion.
Steven
Steven
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Fantastic..
works a treat.. thanks =)
works a treat.. thanks =)
FROM m INNER JOIN
teams tone ON m.HomeTeam = tone.TeamID INNER JOIN
teams ttwo ON m.AwayTeam = ttwo.TeamID
WHERE m.MacthID = <cfqueryparam cfsqltype="cf_sql_integer"