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