SUM
suggest changeSum function sum the value of all the rows in the group. If the group by clause is omitted then sums all the rows.
select sum(salary) TotalSalary
from employees;
TotalSalary|
—— |
2500 |
select DepartmentId, sum(salary) TotalSalary
from employees
group by DepartmentId;
| DepartmentId | TotalSalary| | —— | — | | 1 | 2000 | |2 | 500 |
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents