decode함수나 case when함수 둘중 선택해서 사용 select count(decode(a.tmp, 0, 1)) as cnt_0 --a.tmp의 값이 0일 경우 카운트 , count(decode(a.tmp, 1, 1)) as cnt_1 --a.tmp의 값이 1일 경우 카운트 , count(decode(a.tmp, 2, 1)) as cnt_2 --a.tmp의 값이 1일 경우 카운트 from table a where (where절 필요 시 사용) group by (그루핑 필요 시 사용) 결과값은 이런식으로 나옴