How find Max salary of Each Department
Microsoft Net Framework

SELECT Employee_ID

     , Emp.Name

     , Emp.department_id

     , Emp.Salary

, D.DepartmentName 

FROM (SELECT Employee_ID

           , Name

           , department_id

           , Salary

           , Max(salary) OVER (PARTITION BY Department_ID) dept_max_sal

      FROM EMPLOYEE) AS Emp

  Join Department D on d.Department_ID = Emp.Department_ID

WHERE salary = dept_max_sal;

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM