how to find nth highest salary

Answer Posted / ankur bakliwal

I think this should work -


select top 1 salary from employee where salary in (select
distinct
top n salary from employee order by salary desc) order by
salary asc

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What function does a database engine serve in the sql server?

569


How to execute function in stored procedure sql server?

539


Explain microsoft sql server functions?

542


Do you know what is a linked server in sql server?

547


Explain data warehousing in sql server?

603






Describe in brief system database.

544


What is service broker? : sql server database administration

580


What are the reporting services components?

92


What do you understand by triggers?

522


Differentiate between a local and a global temporary table?

541


What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?

604


What is the sql case statement used for?

559


How can I change procedure name in sql server?

539


How to update values in a table with update statements in ms sql server?

553


What is the purpose of the master database?

602