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;
Could you either edit your answer or add a reply with your full query (part of it seems to have gone walkabouts ). Ideally please format your code too as per the guidance linked below-