SELECT [총 ] = count(age) , [10대] = count(case when age/10=1 then 1 end) , [20대] = count(case when age/10=2 then 1 end) , [30대] = count(case when age/10=3 then 1 end) , [40대] = count(case when age/10=4 then 1 end) , [50대] = count(case when age/10=5 then 1 end) , [60대] = count(case when age/10=6 then 1 end) , [70대] = count(case when age/10=7 then 1 end) , [80대] = count(case when age/10=8 then 1 end) , [90대] = count(case when age/10=9 then 1 end) FROM TABLE