write the query for find the top 2 highest salary in sql
server

Answer Posted / krishna

select * from emp e where 2>=(select count(distinct esal)
from emp where e.esal<=esal)

Is This Answer Correct ?    8 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

is there a column to which a default can't be bound? : Sql server database administration

531


What is inline table-value user-defined function?

582


How to resolve the orphan use problem? : sql server security

521


What are the steps you should follow to start sql server in single-user mode?

474


What is function of ROLLUP ?

640






What is oltp (online transaction processing)?

580


What is sql server locking?

546


What are the advantages of mirroring?

566


What is reportserver and reportservertempdb ?

107


What are the differences between substr and charindex in sql server.

491


Do you know what is difference between stored procedure and user defined function?

608


How to view existing indexes on an given table using sp_help?

590


How many types of subqueries are there in sql server?

461


What is user-defined functions? What are the types of user-defined functions that can be created?

558


What are the ways available in sql server to execute sql statements?

564