SELECT EmpName, Dept, Salary FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY Dept Order By Salary DESC) AS rn FROM mytable4) x WHERE rn = 1
select name, dept, salary from table1 t1 where salary = ( select max(salary) from table1 t2 where t1.dept=t2.dept )
select name,salary from tblname where salary in (select MAX(salary) from tblname)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)