题解 | where 条件里边的子查询,等号(=)左边的组合

找出每个学校GPA最低的同学

https://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065

# select university,min(gpa) from user_profile
# group by university

select device_id,university,gpa from user_profile
where (university,gpa) in 
(select university,min(gpa) from user_profile 
group by university)
order by university;

where 条件里边的子查询,等号(=)左边的组合字段要加上括号:where (字段A,字段B) in (select语句)

全部评论

相关推荐

09-24 18:30
已编辑
长春工业大学 产品经理
小肥罗:HR就是好人的缩写哈哈哈哈
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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