Skip to content
Advertisement

Getting the Top 5 rows by score for each group

I’m trying to get the top 5 comments by score for each Reddit post. I only want to retrieve the top N comments by score for each post title.

Example: I only would want comment 1 and 2 for each post.

StandardSQL

Advertisement

Answer

Below is for BigQuery Standard SQL

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement