我正在使用Metabase在我的数据库上提问。我正在尝试加入两个表,其中相同的信息(用户 ID)有两个不同的名称。我写的代码如下:
SELECT
game_states.game_module AS game, count(*)
FROM
game_states gs LEFT JOIN users u ON gs.user_id = u.id;
WHERE
games_states.state = 'after_hands'
AND
user.last_joined_stamp > now() - interval '30 days'
GROUP BY
1
ORDER BY
2 DESC
我不断收到以下错误: 错误:对表“game_states”的 FROM 子句条目的引用无效提示:也许您打算引用表别名“gs”。职位:127