题解 | #截取出年龄#
对所有员工的薪水按照salary降序进行1-N的排名
http://www.nowcoder.com/practice/b9068bfe5df74276bd015b9729eec4bf
select
SUBSTRING_INDEX(SUBSTRING_INDEX(profile,',',-2),',',1) as age,
count(device_id) as number
From user_submit
Group by age
#subtring_index左右两边限制需要嵌套
#也可用substring(profile,12,2)
查看6道真题和解析