1、求和sum():SELECT sum(字段) from 表名
2、平均数AVG():SELECT AVG(字段) from 表名
3、最小数MIN():SELECT MIN(字段) from 表名
4、最大数MAX():SELECT MAX(字段) from 表名
5、行COUNT():SELECT COUNT(字段) from 表名 ----建议使用 count(*)
@group by
语法: select 分组函数,列(字段) from 表名 where 筛选条件 group by 列(字段)having 分组函数
例:
select count(字段1或*) ,字段2 from 表名 where 字段(筛选 如:id>10) group by 字段2 having count(字段1或*)>1