题解 | #找出每个学校GPA最低的同学#
找出每个学校GPA最低的同学
https://www.nowcoder.com/practice/90778f5ab7d64d35a40dc1095ff79065
使用相关子查询最香:
select device_id,university ,gpa
from user_profile as u
where gpa=(
select min(gpa)
from user_profile
where university= u.university
)
order by university
1 先拉主句的语法,别名表
2 子查询里面找最低gpa
3 子查询的where用表直接链接外表别名,最终会显示所有表的信息