select t2.Department as Department,t2.Name as Employee, t2.salary as Salary from Employee t1 join
    (select b.salary,b.DepartmentId,b.Name as Name,c.name as Department from Employee a join Employee b on a.DepartmentId=b.DepartmentId and a.salary>=b.salary join Department c on b.DepartmentId =c.Id group by b.salary ,b.DepartmentId having count(distinct(a.salary)) <=3) t2 on t1.salary=t2.salary and t1.DepartmentId=t2.DepartmentId order by Department, salary desc