3,491
社区成员
发帖
与我相关
我的任务
分享
1,select decode(trunc(age/10),0,'0-10',1,'10-19',....),count(*) num
from name_age
group by trunc(age/10)
2,
select sum(decode(trunc(age/10),0,1,0)) '0-9',select sum(decode(trunc(age/10),1,,1,0)) '10-19',
.....
from name_age
3,select decode(trunc((age-1)/10),0,'0-10',1,'11-20',....),count(*) num
from name_age
group by trunc((age-1)/10)