SUM() 函数:
SUM 函数返回数值列的总数(总额)。
SQL SUM() 语法:
SELECT SUM(column_name) FROM table_name
-- 实际操作(计算salary总额) :
SELECT SUM(salary) FROM employee;
-- 查询title,salary,按照title分组统计分组和且按照分组之和降序排列:
SELECT title ,SUM(salary) FROM employee GROUP BY title ORDER BY SUM(salary) DESC;