计算机网络/计算机科学与应用/系统/运维/开发

MySQL-MAX()最大值函数

找出tb_student2表中综合成绩的最大值

mysql>SELECT MAX(stu_zonghcj) FROM tb_student2;


找出tb_student2表中“综合成绩”与“系数”相乘后的最大值

mysql>SELECT MAX(stu_zonghcj * stu_xs) as 相乘后最大值 FROM tb_student2;


找出每个班级中综合成绩的最大值,此SQL句法需与GROUP BY关键字一起使用

mysql>SELECT stu_class,MAX(stu_zonghcj) FROM tb_student2 group by stu_class;


微信小程序 https://www.javascriptcn.com/interview-weixinapp/677f48463d78df11d950b260.html

评论

^