27 July 2011

how to find out highest salaried employee details of a table in sqlserver

select * from tblEmp tbl1 where 0=(select count(distinct salary) from tblEmp tbl2 where tbl1.salary<tbl2.salary)



max possible columns per a table in sqlserver is 1024 

No comments: