SELECT SUBSTRING_INDEX (profile, ',', -1) AS gender, COUNT(*) AS number FROM user_submit GROUP BY gender; SELECT IF (profile LIKE '%female', 'female', 'male') AS gender, COUNT(*) AS number FROM user_submit GROUP BY gender; SELECT CASE WHEN profile LIKE ...