回答編集履歴

1

typo

2018/05/31 01:41

投稿

yambejp
yambejp

スコア114814

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