J
John Holmes
I'm trying to design a query to create a record od football/soccer
scores and have two main tables. The tables are as follows
TEAMS
Id The primary key
Team The name of the team
FIXTURES
Id The primary key
Date Date of the match
Home The home team's Id on Teams
Away The away team's Id on Teams
Homegoals
Awaygoals
I created an initial query to obtain the home team's name using
SELECT Fixtures.*, Teams.Team
FROM Teams LEFT JOIN Fixtures ON Fixtures.Home = Teams.Id;
However, I cannot see how to extend it to generate the away team's name
as well.
Could you advise me please.
scores and have two main tables. The tables are as follows
TEAMS
Id The primary key
Team The name of the team
FIXTURES
Id The primary key
Date Date of the match
Home The home team's Id on Teams
Away The away team's Id on Teams
Homegoals
Awaygoals
I created an initial query to obtain the home team's name using
SELECT Fixtures.*, Teams.Team
FROM Teams LEFT JOIN Fixtures ON Fixtures.Home = Teams.Id;
However, I cannot see how to extend it to generate the away team's name
as well.
Could you advise me please.