1241. Number of Comments per Post
https://leetcode.com/problems/number-of-comments-per-post
Description
Table: Submissions
Write an SQL query to find number of comments per each post.
Result table should contain post_id
and its corresponding number_of_comments
, and must be sorted by post_id
in ascending order.
Submissions
may contain duplicate comments. You should count the number of unique comments per post.
Submissions
may contain duplicate posts. You should treat them as one post.
The query result format is in the following example:
ac
Last updated
Was this helpful?