回答編集履歴
1
変更
test
CHANGED
@@ -16,33 +16,37 @@
|
|
16
16
|
|
17
17
|
from (
|
18
18
|
|
19
|
-
select
|
19
|
+
select follow.actor_id
|
20
20
|
|
21
|
-
|
21
|
+
, max(
|
22
22
|
|
23
|
-
|
23
|
+
case when action.action_name='follow' then action.action_date end
|
24
24
|
|
25
|
-
|
25
|
+
) as follow_date
|
26
26
|
|
27
|
-
|
27
|
+
, max(
|
28
28
|
|
29
|
-
fr
|
29
|
+
case when action.action_name='favorite' then action.action_date end
|
30
30
|
|
31
|
-
|
31
|
+
) as favorite_date
|
32
32
|
|
33
|
-
|
33
|
+
from action_datas follow
|
34
34
|
|
35
|
-
|
35
|
+
left join action_datas action
|
36
36
|
|
37
|
-
f
|
37
|
+
on follow.actor_id=action.target_id
|
38
38
|
|
39
|
+
and action.actor_id=1 and action.target_type='user'
|
40
|
+
|
39
|
-
where target_type
|
41
|
+
where follow.target_type='thread' and follow.target_id=20
|
42
|
+
|
43
|
+
group by follow.actor_id
|
40
44
|
|
41
45
|
) thread_follower
|
42
46
|
|
43
47
|
left join main_datas main
|
44
48
|
|
45
|
-
on thread_follower.
|
49
|
+
on thread_follower.actor_id=main.main_id
|
46
50
|
|
47
51
|
left join sub_datas age
|
48
52
|
|