两种方法

  • 使用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;