例:各年齢毎の会員数を算出する
select 年齢,count(*) as 件数 from 会員テーブル
group by 年齢
order by 件数 desc;
年齢 件数
---------- ----------
32 31
34 16
21 15
12 7
23 6