题解 | #统计每种性别的人数#
SELECT ( CASE WHEN FIND_IN_SET ('male', `profile`) > 0 THEN 'male' ELSE 'female' END ) gender, COUNT(*) number FROM user_submit GROUP BY gender;
SELECT ( CASE WHEN FIND_IN_SET ('male', `profile`) > 0 THEN 'male' ELSE 'female' END ) gender, COUNT(*) number FROM user_submit GROUP BY gender;
相关推荐