1
我有一個包含這樣Postgres的錶行選擇
team_id | name | competition_id
--------+---------+------
1 | name 1 | 10
2 | name 2 | 10
列的表的團隊和我也有這個表燈具
fixture_id | home_team_id | away_team_id | competition_id
--------+--------------+--------------+--------------
1 | 1 | 2 | 10
2 | 2 | 1 | 10
爲表燈具
主鍵是fixture_id,home_team_id,away_team_id , 和competition_id。 home_team,away_team和競爭也是外鍵。
如何從燈具中選擇home_team_name,away_team_name。
問題是什麼? – frlan
如何使用join或where子句選擇home_team_name,away_team_name? –