常用的聚合函数有:
平均值:avg()
取个数:count()
取总和:sum()
取最大值:max()
取最小值:min()
用法:select 聚合函数 from 表名 group by 字段名;
例如:
select * from student;
select count(ssex) from student group by ssex;
select count(ssex) as a from student group by ssex having a>3;
转载于:https://www.cnblogs.com/wfc139/p/8954874.html
最后
以上就是幸福保温杯最近收集整理的关于mysql聚合函数的全部内容,更多相关mysql聚合函数内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复