diablo3 Posted September 17, 2011 Share Posted September 17, 2011 I have an SQL table such as this: Pairing1Pairing2Week 611 521 431 132 542 362 and another with teams such as: teamidteamname 1Teamname 1 2Teamname 2 3Teamname 3 The numbers in the pairing are numbers of teams, which is in another SQL table. What would be the most efficient way... of displaying the information in the form of pairngs such as Week 1: Team 6 vs Team 1 Team 5 vs Team 2 etc .... What is the best way for me to sort my results? Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 17, 2011 Share Posted September 17, 2011 SELECT p.Week, t1.teamname, t2.teamname FROM pairings AS p JOIN teams AS t1 ON p.Pairing1 = t1.teamid JOIN teams AS t2 ON p.Pairing2 = t2.teamid ORDER BY p.Week Quote Link to comment Share on other sites More sharing options...
diablo3 Posted September 17, 2011 Author Share Posted September 17, 2011 Thanks!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.