题解 | #查找GPA最高值#

查找GPA最高值

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

两种方法

  • 使用max函数查找最大值
  • 对查询出来的结果降序排列,取第一条数据
# select max(gpa) from user_profile where university='复旦大学';
# 第二种方法 降序排列取第一条数据
SELECT max(gpa) as gpa from user_profile where university='复旦大学' order by gpa desc limit 1;

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务