質問するログイン新規登録

回答編集履歴

1

typo

2018/05/31 01:41

投稿

yambejp
yambejp

スコア117973

answer CHANGED
@@ -1,5 +1,7 @@
1
- ちょっとインチキ臭いですが、日付型と文字列型の組み合わせならいかでいけます
1
+ ちょっとインチキ臭いですが、日付型と文字列型の組み合わせなら以下でいけます
2
2
 
3
3
  ```SQL
4
- select date_format(日時,'%Y-%m') as ym,count(distinct(concat(日時,ID))) from テーブル group by ym;
4
+ select date_format(日時,'%Y-%m') as ym
5
+ ,count(distinct(concat(日時,ID))) cnt
6
+ from テーブル group by ym;
5
7
  ```