i’m wondering why this code:
WITH popular_post AS (
SELECT MAX(posts.score) AS ‘top_scorer’
FROM posts
GROUP BY posts.subreddit_id
)
SELECT *
FROM subreddits
JOIN popular_post
ON subreddits.id = posts.subreddit_id;
do not return the same result of the code suggested by the hint:
SELECT
posts.title,
subreddits.name AS ‘subreddit_name’,
MAX(posts.score) AS ‘highest_score’
FROM posts
INNER JOIN subreddits
ON posts.subreddit_id = subreddits.id
GROUP BY subreddits.id;