I am wanting to get data from one table using information from one. How would I go about doing this?
The
ftv_match table has a home team and an away team id which relate to the
ftv_team table. So what I want to be able to do is get the team names for both of them from the
ftv_team table. The code I have at the moment only gets the name for the home team. What do I need to change to get the name for the away team too?
Code:
SELECT * FROM ftv_match
JOIN ftv_team
ON ftv_match.home = ftv_team.id
Example row from ftv_match
Code:
id home away competition date time channel
5545 243 433 12 2010-07-03 124500 2
Example row from ftv_team
Code:
id name
243 Team X
433 Team Y