我有兩個表中的數據:我需要的數據在Access從2個表
tbl_games
有以下欄目:
game_id, season, date, home_team, visiting_team,
home_score, visiting score, home_score_half_time, visiting score_half_time
tbl_formation
有以下欄目:
game_id, home_formation, home_team, visiting_team, visiting_formation
我想將這些表中的數據附加到game_team
表中,該表包含以下列:
game_id, team_id, status, end_score, half_score, Formation
而是分離出home_team
visiting_team
的,我想將它們全部team_id
和指示它是否是一個主隊或客隊有一定的遊戲狀態下。
我用下面的查詢實驗,但沒有奏效
INSERT INTO Game_Team (game_id, Team_ID, End_Score, half_score, Formation)
SELECT G.game_id, G.home_team, G.home_score_half_time, G.home_score, GL.home_formation
FROM tbl_games AS G
INNER JOIN tbl_formation AS GL ON G.game_id = GL.game_id;
,如果你想看到的數據,那麼你爲什麼要使用INSERT INTO? –
它怎麼沒用?任何錯誤?請張貼他們。不是期望的結果? –