Last active
April 9, 2016 05:17
-
-
Save hpcslag/069e230fa8e23fe0ae933daf4cde086c to your computer and use it in GitHub Desktop.
比賽表,兩筆資料從一張表搜尋(國家),一張表的兩筆資料,參照替換成第二張表的參考
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT G.Home, G.Away, | |
C1.CountryName, C2.CountryName | |
FROM Game G | |
JOIN Country C1 ON C1.CountryID = G.Home | |
JOIN Country C2 ON C2.CountryID = G.Away; | |
--http://stackoverflow.com/questions/4267929/whats-the-best-way-to-join-on-the-same-table-twice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
d