1
を取得するには、テーブルに参加カウントは私のSQLここでは4列を有する私のタイプ別にグループおよび自己ここで要約
select count(type), type
from tasks
group by type
です。
count(type) type
8 Trial
7 New
3 Service
4 Uninstall
にはどうすればリターン
Trial New Service Uninstall
8 7 3 4
私はそれが自己入社テーブルに持って知っている中で1行結果で入手できます。しかし、私は正確に得ることができません。
はここでこれは条件付きの集約で行われているサンプル・テーブル・データ
id type date
1 New 2017-10-07
2 Trial 2017-10-01
3 New 2017-10-02
4 Uninstall 2017-10-05
5 Trial 2017-10-06
6 Trial 2017-10-07