I have a table A whose primary key is a foreign key in two columns on table B. I am trying to join both tables so as to get the output as one table as names are in table B and IDs are in table A.
I tried using the query below but it works for only one column and doesn't for the other one
"select team.team_long_name home_team, match.home_team_api_id, team.team_long_name away_team, match.away_team_api_id
on match.home_team_api_id = team.team_api_id
on match.away_team_api_id = team.team_api_id"
The output this gives is the home team ID and the right Home team name, the Away team id but the wrong away team name. It gives the same output as the home team name.