SELECT created_at, where between date(now()) and date(now()) +interval 1day, DATEDIFF(day, created_at, where between date(now()) and date(now()) +interval 1day ) FROM users;
平均クリック数/日
が欲しくて、平均を取るために、登録日から現在までの日数を出したくて、
上記になりました。
テーブルは、users
カラム(関係ありそうな部分)は、id , created_at
日付の形式は、2018-04-08 19:35:50
になります。
エラー文は、
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, DATEDIFF(day, created_at, w' at line 2```
回答1件
あなたの回答
tips
プレビュー