题解 | #统计每种性别的人数#
统计每种性别的人数
http://www.nowcoder.com/practice/f04189f92f8d4f6fa0f383d413af7cb8
SELECT
SUBSTR(profile,15) AS gender, COUNT(device_id)AS number
FROM user_submit
SUBSTR(profile,15) AS gender, COUNT(device_id)AS number
FROM user_submit
GROUP BY gender;
substr(字段名,n)返回字段中第n位开始的字符