sql:
select gwlb, count(case when (year(getdate())-year(rybirthday)) between 20 and 30 then rygh end) as '20-30',
 count(case when (year(getdate())-year(rybirthday)) between 30 and 40 then rygh end) as '30-40',
 count(case when (year(getdate())-year(rybirthday)) between 40 and 50 then rygh end) as '40-50',
 count(case when (year(getdate())-year(rybirthday)) between 50 and 60 then rygh end) as '50-60',
 count(case when (year(getdate())-year(rybirthday)) between 60 and 70 then rygh end) as '60-70'
from t_ry
group by gwlb

相关文章:

  • 2022-03-05
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-02-03
  • 2021-12-27
  • 2021-12-04
  • 2021-09-18
相关资源
相似解决方案