回答編集履歴
4
f
test
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
```
|
2
2
|
SELECT active_users.date,
|
3
|
-
COUNT(DISTINCT active_users.user_id) AS active_user
|
3
|
+
COUNT(DISTINCT active_users.user_id) AS active_user,
|
4
|
-
COUNT(DISTINCT tomorrow_active_users.user_id) AS tomorrow_active_user
|
4
|
+
COUNT(DISTINCT tomorrow_active_users.user_id) AS tomorrow_active_user
|
5
5
|
FROM active_users
|
6
6
|
LEFT JOIN active_users AS tomorrow_active_users
|
7
7
|
ON active_users.date = DATE_SUB(tomorrow_active_users.date, INTERVAL 1 DAY)
|
3
fix
test
CHANGED
@@ -4,6 +4,6 @@
|
|
4
4
|
COUNT(DISTINCT tomorrow_active_users.user_id) AS tomorrow_active_users
|
5
5
|
FROM active_users
|
6
6
|
LEFT JOIN active_users AS tomorrow_active_users
|
7
|
-
ON active_users.date = DATE_SUB(tomorrow_active_users.date, INTERVAL 1 DAY)
|
7
|
+
ON active_users.date = DATE_SUB(tomorrow_active_users.date, INTERVAL 1 DAY)
|
8
8
|
GROUP BY active_users.date;
|
9
9
|
```
|
2
f
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
```
|
2
2
|
SELECT active_users.date,
|
3
|
-
COUNT(DISTINCT active_users.user_id) AS
|
3
|
+
COUNT(DISTINCT active_users.user_id) AS active_users,
|
4
4
|
COUNT(DISTINCT tomorrow_active_users.user_id) AS tomorrow_active_users
|
5
5
|
FROM active_users
|
6
6
|
LEFT JOIN active_users AS tomorrow_active_users
|
1
fix
test
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
```
|
2
|
-
SELECT active_users.date
|
2
|
+
SELECT active_users.date,
|
3
|
-
COUNT(DISTINCT active_users.user_id) AS c
|
3
|
+
COUNT(DISTINCT active_users.user_id) AS active_users,
|
4
|
-
COUNT(DISTINCT tomorrow_active_users.user_id) AS
|
4
|
+
COUNT(DISTINCT tomorrow_active_users.user_id) AS tomorrow_active_users
|
5
5
|
FROM active_users
|
6
6
|
LEFT JOIN active_users AS tomorrow_active_users
|
7
7
|
ON active_users.date = DATE_SUB(tomorrow_active_users.date, INTERVAL 1 DAY) AND active_users.user_id = tomorrow_active_users.user_id
|