Get Max salary of Employee each Department Ask Question
By       29-Apr-2025    1

How Get Max salary of Employee By Each department  With Employee Name ,Employee _ID ,Employee_Department ??

Solutions


Rizwan Saqib

Get Max salary of Employee each Department

 

SELECT emp.Employee_ID, emp.Department_ID, emp.EmployeeName, emp.salary, dpt.DepartmentName

FROM Employees AS emp

JOIN Departments AS dpt ON emp.Department_ID = dpt.Department_ID

JOIN(SELECT   Department_ID  , MAX(salary) AS maxsalary FROM  Employees GROUP BY Department_ID) AS empMax

ON emp.Department_ID = empMax.Department_ID AND emp.salary = empMax.maxsalary Order by Salary desc

10060
Copyright Future Minutes © 2015- 2025 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM