select age, count(user_age.age)as number from ( select substring_index(substring_index(profile, ',', -2), ',', 1) as age from user_submit ) as user_age group by age 遇到的小插曲 将substring_index 错写成substring。