質問編集履歴
1
追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,9 +1,39 @@
|
|
1
|
+
```ここに言語を入力
|
2
|
+
|
1
3
|
SELECT created_at, where between date(now()) and date(now()) +interval 1day,
|
2
4
|
|
3
5
|
DATEDIFF(day, created_at, where between date(now()) and date(now()) +interval 1day ) FROM users;
|
4
6
|
|
7
|
+
```
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
5
|
-
|
13
|
+
**平均クリック数/日**
|
6
14
|
|
7
15
|
が欲しくて、平均を取るために、登録日から現在までの日数を出したくて、
|
8
16
|
|
9
17
|
上記になりました。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
テーブルは、users
|
22
|
+
|
23
|
+
カラム(関係ありそうな部分)は、id , created_at
|
24
|
+
|
25
|
+
日付の形式は、2018-04-08 19:35:50
|
26
|
+
|
27
|
+
になります。
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
エラー文は、
|
32
|
+
|
33
|
+
```ここに言語を入力
|
34
|
+
|
35
|
+
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'between date(now()) and date(now()) +interval 1day,
|
36
|
+
|
37
|
+
DATEDIFF(day, created_at, w' at line 2```
|
38
|
+
|
39
|
+
```
|