select count(case when ceil(months_between(sysdate,birthday)/12) >=20 and ceil(months_between(sysdate,birthday)/12) <30 then 1 else 0 end) "20-30", count(case when ceil(months_between(sysdate,birthday)/12 >=30) and ceil(months_between(sysdate,birthday)/12 <40) then 1 else 0 end) "30-40", ... ... ..."50-65" from Person
count(case when ceil(months_between(sysdate,birthday)/12 >=30) and ceil(months_between(sysdate,birthday)/12 <40) then 1 else 0 end) "30-40",
...
... ..."50-65"
from Person