I'm new at this but I'm trying to combine the columns in the SELECT
statement from the player_game_log
table and the date
column in the game
table, but I get No such table as game.date
and when I remove the .date.
then I get an error saying ambiguous column name: game_id
. What am I getting wrong?
-- Jalen Green player_id = 1630224
SELECT player_id, game_id, pts, reb, ast
FROM player_game_log
INNER JOIN
game.date
ON
player_game_log.game_id = game.game_id
WHERE player_id = 1630224
ORDER BY pts DESC;
CodePudding user response:
ambiguous column name: game_id
means that you have a game_id
column in more than one of the tables you are JOINing, so when you say SELECT game_id
the database doesn't know which one you want.
You need to specify which one you mean, like SELECT game.game_id
.