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

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

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

with cte as(
select university,age,count(distinct device_id ) as num
from user_profile 
group by university,age )
select age,max(num) as max_cnt
from cte 
group by age 
order by max_cnt desc,age desc

全部评论

相关推荐

下个早班:秒挂就是不缺人
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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