mysql分组函数

#分组函数:用作统计使用,可嵌套使用
USE myemployees;
#sum 求和
SELECT SUM(salary) FROM employees;
#avg 求平均
SELECT AVG(salary) FROM employees;
#max 求最大值
SELECT MAX(salary) FROM employees;
#min 求最小值
SELECT MIN(salary) FROM employees;
#count 计算个数
SELECT COUNT(salary) FROM employees;

网页题目:mysql分组函数
文章分享:http://ybzwz.com/article/pgijhe.html