sql - Group by clause to get name of highest paid employee -


I have a table worker with field department, employee wage salary, I pay the salary of the department and the employee's salary I need a query for the list of names

I know it is simple I googled but got the answer like this, which only list of department and salary

  SELECT DEPT, SUM (salary) from staff group department;    

Supports SQL Server 2008 Window Functions It helps you do what you want. In the form of an archive list (Selection department, employee name, salary, DNSERA) (Department by Department of DESC Salary by the Department) RN From the employee) Selecting department, employee name, payroll from WHERE rn = 1



Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -