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

You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?

549


what is dbcc? : Sql server database administration

529


Benefits of Stored Procedures?

572


What is a trigger? Why we need it?

535


How can you insert null values in a column while inserting the data?

722






What happens if null values are involved in string operations?

560


Do you know what is xpath?

559


What is database replication? What are the different types of replication you can set up in sql server?

502


What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas

550


How to turn on the mssql api module in php?

569


How do I view a stored procedure in sql server query?

540


What is the use of sql profiler in sql server 2012?

515


Explain can SSRS reports Cache results?

112


What are approximate numeric data types in ms sql server?

591


what are user defined datatypes? : Sql server database administration

522