Following on from Select first row in each GROUP BY group? I am trying to do a very similar thing in Google big query.
Dataset: fh-bigquery:reddit_comments.2018_01
Aim: For each link_id (Reddit submission) select the first comment in terms of created_utc
SELECT body,link_id
FROM [fh-bigquery:reddit_comments.2018_01]
where subreddit_id == "t5_2zkvo"
group by link_id ,body, created_utc
order by link_id ,body, created_utc desc
At the moment it's not working, because it's still not giving me unique/distinct parent_id(s)
Please and thank you!
EDIT: I was incorrect when saying that parent_id is == to submission, it's actually link_id