SUM

suggest change

Sum 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 |

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Functions Aggregate:
*SUM

Table Of Contents