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

Answer Posted / srinivas

select e1.sal from emp e1 where 2=(select count(distnct
(e2.sal) from emp e2 where e2.sal>=e1.sal)

Is This Answer Correct ?    33 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me about pre-defined functions of sql?

702


Explain the difference between delete,drop and truncate in SQL Server?

601


How to change the password of a login name in ms sql server?

572


Differentiate sql server reporting services vs. Crystal reports?

152


What is 1nf normalization form?

607






How do I start and stop sql server?

556


How to rename an existing column with sql server management studio?

513


You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?

579


You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?

650


what is a schema in sql server 2005? : Sql server database administration

527


What is trigger explain with program?

548


How do you improve the performance of a SQL Azure Database?

117


What is the difference between writing data to mirrored drives versus raid5 drives

519


How to read data in a table with "select" statements?

572


Which is better statement or preparedstatement?

535