题解 | 查找GPA最高值

查找GPA最高值

https://www.nowcoder.com/practice/4e22fc5dbd16414fb2c7683557a84a4f

select max(gpa) as gpa from user_profile where university='复旦大学';
  • 限定条件:复旦大学学生,university='复旦大学'
  • gpa最高值:max(gpa);当然也可以按gpa降序排序,取第一名

细节问题:

  • 表头重命名:as

完整代码:

'''

# 方法1

# selectmax(gpa) asgpa

# fromuser_profile

# whereuniversity='复旦大学';

# 方法2

selectgpa

fromuser_profile

whereuniversity='复旦大学'

orderbygpa desclimit 1

'''

全部评论

相关推荐

点赞 评论 收藏
分享
04-28 22:33
已编辑
门头沟学院 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务