本文共 292 字,大约阅读时间需要 1 分钟。
聚合函数
求总和
求总数
- 格式:count(列名);
- 注意:如果列名中存在null值得数据,统计时不会参与进来 -查询总数量: count(*)或者count(常量值)
求平均值函数
求最大值
求最小值
分组 group by
- 格式: select 分组依据列,其他 from 表名 group by 分组依据列
- 进阶格式: select 分组依据列,其他 from 表名 group by 分组依据列 having 小组条件
- 多列分组格式: group by 分组依据列1,分组依据列n
转载地址:http://rcex.baihongyu.com/