
id | status
1 | 1000
2 | 1000
3 | 2000
4 | 2000
5 | null
6 | null
7 | 3000
SELECT id, status,count(*) FROM 対象テーブル
GROUP BY status
としたとき、statusがnullの値はグループ化せず、
countを取る方法を知りたいです。
希望するレスポンスは
id | status | count(*)
1 | 1000 | 2
3 | 2000 | 2
5 | null | 1
6 | null | 1
7 | 3000 | 1


回答4件
あなたの回答
tips
プレビュー