我想根據下表獲取每個團隊的計劃,但我在獲取團隊名稱時顯示出一些問題。這裏是我的表:針對團隊計劃的MySQL查詢
TEAM (TEAM_ID, TEAM_NAME, team_mascot, 等)
GAME (game_id, GAME_DATE, game_home_team, game_visitor_team, game_home_score, game_visitor_score, game_complete )
這是我目前的查詢。我能夠通過這個獲得團隊的id值,但是我需要團隊名稱,因爲id值對我來說不會有太大幫助。
SELECT game_home_team, game_visitor_team, game_date
FROM game
INNER JOIN team home ON home.team_id = game_home_team
INNER JOIN team visitor ON visitor.team_id = game_visitor_team
WHERE game_home_team = ?
OR game_visitor_team = 6
ORDER BY game_date ASC;
我怎麼能與此查詢檢索的隊名也顯示結果如W或L視得分爲遊戲?非常感謝提前。
哪支球隊你想賣,遊客或家庭的W和L? – DrinkJavaCodeJava 2012-07-17 18:29:37