How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database

plz mail the answer @ mak2786@gmail.com

Answer Posted / sarat

TO FIND THE Nth HIGHEST SAL IN EMP TABLE

SELECT MIN (salary) as NthSalary FROM emptable WHERE
salary IN ( SELECT DISCINCT TOP N salary FROM emptable
ORDER BY salary DESC )

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are parameterized reports?

160


What is SQL Azure?

85


How to create hyperlink from returned sql query ?

618


What are subquery and its properties?

571


What is the report model project?

103






How to get a list of columns in a view using "sys.columns" in ms sql server?

513


System requirements for sql server 2005 express edition?

564


What is table constraint?

539


What are the default system databases in sql server 2000?

536


How to delete database objects with "drop" statements in ms sql server?

592


Do you know clustered and non-clustered index?

522


How to use column default values in insert statements in ms sql server?

523


What is 3nf normalization?

560


What is an expensive query?

536


What to perform pattern match with the like operator?

482