select cnt1,cnt2,cnt3 from (select count(*) cnt1 from mytab where class='01') a, (select count(*) cnt2 from mytab where class='02') b, (select count(*) cnt3 from mytab where class='03') c ;
select count(case class when '01' then class else null end) as class01, count(case class when '02' then class else null end) as class02, count(case class when '03' then class else null end) as class03 from mytab
from
(select count(*) cnt1 from mytab where class='01') a,
(select count(*) cnt2 from mytab where class='02') b,
(select count(*) cnt3 from mytab where class='03') c
;
count(case class when '02' then class else null end) as class02,
count(case class when '03' then class else null end) as class03
from mytab