SUBSTRING_INDEX的用法SUBSTRING_INDEX(string,'分隔符',n[从起始取到第n个分隔符前])SUBSTRING_INDEX(string,'分隔符',-n[从倒数第n个分隔符后取到结束]) select gender, count(*) as number from ( select SUBSTRING_INDEX(profile,',',-1) as gender from user_submit ) tab group by gender