I have two tables:
teams
----------------
|uid|name |rank|
----------------
| 1 |Team1| 1 |
| 2 |Team2| 2 |
----------------
games
-----------------------------------------------------------------------
|uid|team_one_uid|team_one_score|team_two_uid|team_two_score|game_date|
-----------------------------------------------------------------------
|1|1|70|2|50|2012-12-12|
The teams table has a list of teams and other data like a rank.
The games table has a list of games and references each team by it’s unique id (uid).
What query can I run in order to see a result that contains a row with the following columns:
game_uid, team_one_name, team_one_rank, team_one_score, team_two_name, team_two_rank, team_two_score, game_date
1 Answer