To find second largest salary in Employee table

Answer Posted / murugesh

select * from (select row_number over( order by salary
desc) as salcount,empid,salary from employee) emp
where emp.salcount = 2

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is temporary table in sql server? Why we use temp table?

521


Explain what is the purpose of sql profiler in sql server?

554


How you can change a cross join into an inner join?

555


How to return the date part only from a sql server datetime datatype?

582


What is policy based management (pbm)? : sql server database administration

585






What is ms sql server index?

565


What is the security principal at the database level that represents your session?

541


What do you mean by subquery?

587


What are the new security features added in sql server 2012? : sql server security

536


How many tables can be joined in SQL Server?

594


Can we add a cpu to sql server?

526


How except clause is differs from not in clause?

538


How to create “dependant” parameter “make, model, year”

89


What are the restrictions while creating batches in sql server?

587


Please differentiate between a local and a global temporary table?

573