1.分组求和
SELECT `name`,SUM(score) FROM test2 GROUP BY `name`;
2.分组求平均
SELECT `name`,AVG(score) FROM test2 GROUP BY `name`;
3.分组求最大
SELECT `subject`,MAX(score) FROM test2 GROUP BY `subject`;
4.分组求最小
SELECT `subject`,MIN(score) FROM test2 GROUP BY `subject`;