Categories
Sql Server

Query to get total salary of a Department

Query to get total salary of a Department

In organizations their are several departments.To calculate the total salary of that department in SQL server is so easy.

Query:

select deptno ,sum(basic) as total from emp group by deptno

Here Deptno refers to Dept which salary you want calculate and basic refers to the Salary column of the employee.