Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
enya007
Starting Member
1 Post |
Posted - 2007-09-03 : 12:59:11
|
| Hi,I am quite new to SQL so forgive me if this problem is trivial. I have two tables: players and matches. 1st one contains players names and other data, 2nd one contains player1id, player2id and other data. Question is how to make one sql select query to get all records from matches but insted of player1 id and player2 id I would like to get player1 and player2 name from players table.Thanks for help. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-03 : 13:13:52
|
JOIN two times.SELECT m.*, p1.PlayerName, p2.PlayerNameFROM Mathes AS mINNER JOIN Players AS p1 ON p1.PlayerID = m.Player1IDINNER JOIN Players AS p2 ON p2.PlayerID = m.Player2ID E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|