select '25-30岁' as 年龄段 count(*) as 人数 from tb where year(getdate())-year(birthday)>=25 and year(getdate())-year(birthday)<30
union all
select '30-35岁' as 年龄段 count(*) as 人数 from tb where year(getdate())-year(birthday)>=30 and year(getdate())-year(birthday)<35
union all
select '35-40岁' as 年龄段 count(*) as 人数 from tb where year(getdate())-year(birthday)>=35 and year(getdate())-year(birthday)<40
select count(*) as 25-30岁 from table where data>1985-10-12 and date<...
union all
select count(*) as