bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 1149. Article Views II

1149. Article Views II

Leetcode Solutions

Groupby with Having

  1. Group the data by viewer_id and view_date.
  2. Count the number of distinct article_id for each group.
  3. Use the HAVING clause to filter groups where the count of distinct articles is greater than one.
  4. Select the distinct viewer_id from the filtered results as the final output.
  5. Order the result by viewer_id in ascending order.

erDiagram
    Views {
        int article_id
        int author_id
        int viewer_id
        date view_date
    }

Self-Join

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...