SELECT D.name AS Department, E.name AS Employee, E.Salary AS SalaryFROM Employee AS E JOIN Department AS DON E.DepartmentId=D.IdWHERE ( SELECT COUNT(DISTINCT Ein.Salary) FROM Employee AS Ein WHERE Ein.Salary > E.Salary AND Ein.DepartmentId=E.DepartmentId)<3;