More than 1 year has passed since last update.

1.日毎
  group by date(created)

2.周毎
 ・日曜日開始
  group by date(created + interval 1 - DAYOFWEEK(created) day)
 ・月曜日開始
  group by date(created - interval (5 + DAYOFWEEK(created))%7 day)

3.月毎
  group by date(created + interval 1 - DAYOFMONTH(created) day)
  或いは
  group by date_format(created, '%Y-%m')

※createdのデータ型はDATETIME

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.