StackOverflow 文件 SQL 教程 功能(聚合) 和 和 Created: November-22, 2018 Sum 函式求和組中所有行的值。如果省略 group by 子句,則對所有行求和。 select sum(salary) TotalSalary from employees; TotalSalary 2500 select DepartmentId, sum(salary) TotalSalary from employees group by DepartmentId; DepartmentID TotalSalary 1 2000 2 500 AVG()列出連線