题解 | #统计每个学校的答过题的用户的平均答题数#
统计每种性别的人数
http://www.nowcoder.com/practice/f04189f92f8d4f6fa0f383d413af7cb8
SELECT SUBSTR(profile,15) gender,COUNT(device_id) number
FROM user_submit
GROUP BY gender;
感觉用SUBSTR最好理解,类似于python中的":",取15位以后的就可以了。
统计每种性别的人数
http://www.nowcoder.com/practice/f04189f92f8d4f6fa0f383d413af7cb8
SELECT SUBSTR(profile,15) gender,COUNT(device_id) number
FROM user_submit
GROUP BY gender;
感觉用SUBSTR最好理解,类似于python中的":",取15位以后的就可以了。
相关推荐