SQL query that would return the average salary per department using AVG as aggregate function

Rajnilari2015
Posted by Rajnilari2015 under Sql Server category on | Points: 40 | Views : 961
Let's say we have a table tblTest as under

Name          		Salary          	Department

Debasis Dey 15000 IT Software
Sarbajit Das 30000 IT Hardware
Dipanjan Nagi 25000 IT Software


The expected output should be

Department          	Salary

IT Software 20000
IT Hardware 30000


Query
------


Select Department, AVG(Salary) AS Salary
FROM tblTest
Group By Department
Order By Department DESC

Comments or Responses

Login to post response