输入banner图图片脚本导航/分类

Mysql 分组查询最高分

-- 查询每个班的冠军团队 2 SELECT a.* 3 FROM t_mfg_ClassGameGroup a INNER JOIN ( 4 SELECT f_ClassId , MAX(f_Score) Score 5 FROM t_mfg_ClassGameGroup GROUP BY f_ClassId) b 6 ON a.f_ClassId = b.f_ClassId AND a.f_Score = b.Score 7 ORDER BY a.f_ClassId

查询结果

技术分享

2 数据都是模拟的

-- 增加一组人的分
UPDATE t_mfg_Student SET f_Score = f_Score + 10 
WHERE f_uid IN (SELECT f_UID FROM t_mfg_UserGroup WHERE    f_groupId = 2)

用这两个工具语句就可以实现更新了

Mysql 分组查询最高分

标签: