回答編集履歴
3
見直し
test
CHANGED
@@ -36,6 +36,10 @@
|
|
36
36
|
|
37
37
|
GROUP BY sub_ar.user_id
|
38
38
|
|
39
|
-
)
|
39
|
+
)
|
40
|
+
|
41
|
+
ORDER BY ar.user_id;
|
40
42
|
|
41
43
|
```
|
44
|
+
|
45
|
+
ORDER BY句が必要な気がするけど、とくに条件が指定されていないので、user_id順にしてみた。
|
2
見直し
test
CHANGED
@@ -14,7 +14,11 @@
|
|
14
14
|
|
15
15
|
ar.user_id,
|
16
16
|
|
17
|
+
ar.type,
|
18
|
+
|
17
|
-
ar.updated_at
|
19
|
+
ar.updated_at,
|
20
|
+
|
21
|
+
ar.deleted_at
|
18
22
|
|
19
23
|
FROM articles AS ar
|
20
24
|
|
1
見直し
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
AND sub_ar.updated_at <= {指定の日付(Y-m-d)}
|
30
30
|
|
31
|
-
AND deleted_at IS null
|
31
|
+
AND sub_ar.deleted_at IS null
|
32
32
|
|
33
33
|
GROUP BY sub_ar.user_id
|
34
34
|
|