题解 | #每个年龄的学生在各学校最大数量#

每个年龄的学生在各学校最大数量

https://www.nowcoder.com/practice/8a2a416d26144c93b67e26581764d8ab

select
distinct t.age,
t.max_cnt
from(
select 
age,
count(id) as max_cnt,
dense_rank()over(partition by age order by count(id) desc) as pt
from user_profile
group by age,university
) as t 
where
t.pt=1
order by max_cnt desc,t.age desc

全部评论

相关推荐

03-27 17:33
门头沟学院 Java
代码飞升:同学院本,你要注意hr当天有没有回复过,早上投,还要打招呼要推销自己,不要一个劲投
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务