select name,count(1)from (
select birthday,(case when birthday  between '1940' and '1949' then '40后' 
when birthday  between '1950' and '1959' then '50后' 
when birthday  between '1960' and '1969' then '60后' 
when birthday  between '1970' and '1979' then '70后' 
when birthday  between '1980' and '1989' then '80后' 
when birthday  between '1990' and '1999' then '90后' 
else '00后' 
 end) name from ( 
select SUBSTRING(id_number,7,4) AS birthday from v_app_queue_sq
where 
id_number<>'' AND id_number IS NOT NULL AND  LENGTH(id_number)=18
) m) b group by name

mysql根据身份证号码查询出几零后分布

相关文章:

  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-02-04
  • 2022-01-23
猜你喜欢
  • 2021-12-17
  • 2021-09-27
  • 2022-02-19
  • 2021-06-06
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案