Skip to content

Commit aeef687

Browse files
authored
Update Reported posts.sql
1 parent fb9e088 commit aeef687

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Easy/Reported posts.sql

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,28 @@
5151
Select extra as report_reason, count(distinct post_id) as report_count
5252
from actions
5353
where action_date = DATE_SUB("2019-07-5", INTERVAL 1 DAY) and action='report'
54-
group by extra
54+
group by extra
55+
56+
57+
My sol:
58+
1.
59+
select extra as report_reason, count(distinct post_id) as report_count
60+
from (select distinct post_id, action_date, action, extra from Actions) a
61+
where extra is not null and datediff(day, action_date, '2019-07-05') = 1
62+
group by extra
63+
64+
2.
65+
select extra as report_reason, count(action) as report_count
66+
from (select distinct post_id, action_date, action, extra from Actions) a
67+
where extra is not null and datediff(day, action_date, '2019-07-05') = 1
68+
group by extra
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+

0 commit comments

Comments
 (0)