SELECT distinct (substring(profile, 12, 2)) as age, count(device_id) as number FROM user_submit GROUP BY age 上述这种方法只能用于参赛人员的体重身高位数一样,不严谨。大佬分享的嵌套方法更加严谨。 #大佬嵌套方法: select substring_index (substring_index (profile, ',', -2), ',', 1) as age, count(device_id) as number from user_submit GROUP by age