mysql中最大值的用法?mysql查詢最大值語(yǔ)句是:首先通過(guò)對(duì)stuname字段進(jìn)行分組;然后再用MAX函數(shù)對(duì)每組中的最大值進(jìn)行計(jì)算即可。
ysql查詢最大值語(yǔ)句是:
1、方法1SELECT a.stuname,MAX(a.score) AS score FROM stuscore a GROUP BY a.`stuname` ;
2、方法2:使用連接SELECT a.stuname,a.score AS score FROM stuscore a JOIN
stuscore b ON a.`stuname`=b.`stuname`
GROUP BY a.`score` HAVING