题解 | #截取出年龄#
截取出年龄
https://www.nowcoder.com/practice/b8d8a87fe1fc415c96f355dc62bdd12f
select left(a,2) age,count(1) from (select substring_index(profile,',',-2) a from user_submit )b group by age; 这里假定的参赛者年龄不能超过100岁,left替换成substring_index更好
截取出年龄
https://www.nowcoder.com/practice/b8d8a87fe1fc415c96f355dc62bdd12f
select left(a,2) age,count(1) from (select substring_index(profile,',',-2) a from user_submit )b group by age; 这里假定的参赛者年龄不能超过100岁,left替换成substring_index更好
相关推荐