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 do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?

530


Where sql server user names and passwords are stored in sql server? : sql server database administration

586


wat wil hapn if we give the both read and deny read permission to user?

1660


How to create a dml trigger using create trigger statements?

566


List all types of constraints in sql server?

520






What are the parts of a function?

530


How can windows applications connect to sql servers via odbc?

595


What is mssql?

574


How to get a list of columns using the "sp_help" stored procedure in ms sql server?

588


What is similarity and difference between truncate and delete in sql?

599


Explain filtered indexes?

564


What is a rownum?

509


Write the queries for commands like Create Table, Delete table, Drop Table etc.

619


Mention the differences between having and where clause.

564


Is a primary key unique?

545