Loading problem...
An analytics table records article view activity in this schema:
views columns:
Data notes:
Task:
Supported submission environments:
views:
| article_id | author_id | viewer_id | view_date |
|------------|-----------|-----------|-------------|
| 1 | 3 | 5 | 2019-08-01 |
| 1 | 3 | 6 | 2019-08-02 |
| 2 | 7 | 7 | 2019-08-01 |
| 2 | 7 | 6 | 2019-08-02 |
| 3 | 4 | 4 | 2019-07-21 |
| 3 | 4 | 4 | 2019-07-21 |[
{"id":4},
{"id":7}
]Authors 4 and 7 each have at least one row where author_id == viewer_id. Duplicate self-view rows for author 4 still contribute only one output row.
views:
| article_id | author_id | viewer_id | view_date |
|------------|-----------|-----------|-------------|
| 10 | 2 | 8 | 2020-01-01 |
| 11 | 2 | 9 | 2020-01-02 |
| 12 | 5 | 6 | 2020-01-03 |[]No row has author_id equal to viewer_id, so no author qualifies.
views:
| article_id | author_id | viewer_id | view_date |
|------------|-----------|-----------|-------------|
| 20 | 9 | 9 | 2021-05-10 |
| 21 | 9 | 9 | 2021-05-11 |
| 22 | 9 | 3 | 2021-05-12 |
| 23 | 2 | 2 | 2021-05-12 |[
{"id":2},
{"id":9}
]Both authors 2 and 9 have at least one self-view. Multiple self-view rows for the same author do not create duplicates in output.
Constraints