how to find nth highest salary

Answer Posted / sharmila shree

SELECT TOP 1 salary FROM
( SELECT DISTINCT TOP 1 salary FROM table_name
ORDER BY salary DESC )
a ORDER BY salary

here 'a' is sub query of salary

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is transaction server isolation?

592


You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

500


Can you explain various data region available in ssrs with their use?

557


What is difference between rollback immediate and with no_wait during alter database?

595


Is t sql the same as sql server?

528






What is resource db in sql server?

607


Can you explain what are commit and rollback in sql?

499


What are the types of joins in sql?

575


Why do we use trigger?

567


What is indexing a document?

561


What is a cube? : sql server analysis services, ssas

574


What are unicode character string data types in ms sql server?

617


1 01 101 01010

1580


What is the difference between a view and a stored procedure?

575


How do you size a resultset?

514