回答編集履歴
1
typo
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
|
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
|
```
|