mysql 分组和聚合函数 Mysql 聚集函数有5个: 1.COUNT() 记录个数(count(1),count(*)统计表中行数,count(列名)统计列中非null数) 2.MAX() 最大值 3.MIN() 最小值 4.AVG()平均值 5.SUM() 求和 聚集函数常常和分组一起工作. 1.创建分组 select name, max(age) from stu group by name; 2.过滤分组 select name, max(age) from stu group by…