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

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

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

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-08 10:39
一个证都没 我能填什么
程序员小白条:别人有,你为什么没有,还是这个道理,社会就是比较,竞争,淘汰,你要安逸,那么就要做好淘汰的准备
点赞 评论 收藏
分享
下北澤大天使:你是我见过最美的牛客女孩😍
点赞 评论 收藏
分享
06-07 17:17
嘉兴学院 教师
心爱的idea:你孩
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务