I have 3 tables: Team, Result, and Fixture
Team contains: TeamId, TeamName
Result contains: FixtureId, TeamId, Goals
Fixture contains: FixtureId, Time
For each fixture:
- one entry is made into the Fixture table with a unique FixtureId
- 2 entries are made into the Result table- each with a seperate TeamId and the same FixtureId
I wish to display a table with header: FixtureId,TeamName1,TeamName2
but so far I have only been able to create a table with header:
FixtureId,TeamName
which for example displays 2 rows for the same FixtureId, each displaying a different team name.
the SQL query used to do this is:
SELECT Fixture.FixtureId, Team.TeamName
FROM Team, Result, Fixture
WHERE Fixture.FixtureId=Result.FixtureId And Team.TeamId=Result.TeamId;
Can anyone please help me with a join query to display a fixture as one row?
Thanks.
Team contains: TeamId, TeamName
Result contains: FixtureId, TeamId, Goals
Fixture contains: FixtureId, Time
For each fixture:
- one entry is made into the Fixture table with a unique FixtureId
- 2 entries are made into the Result table- each with a seperate TeamId and the same FixtureId
I wish to display a table with header: FixtureId,TeamName1,TeamName2
but so far I have only been able to create a table with header:
FixtureId,TeamName
which for example displays 2 rows for the same FixtureId, each displaying a different team name.
the SQL query used to do this is:
SELECT Fixture.FixtureId, Team.TeamName
FROM Team, Result, Fixture
WHERE Fixture.FixtureId=Result.FixtureId And Team.TeamId=Result.TeamId;
Can anyone please help me with a join query to display a fixture as one row?
Thanks.