how to find nth highest salary

Answer Posted / sitakanta rath

SELECT sal FROM
(
SELECT DENSE_RANK() OVER (ORDER BY sal DESC) AS rank, sal
FROM Emp
) T2
WHERE rank=@n

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1 01 101 01010

1679


What are the Advantages of using CTE in sql server?

656


What is the full form of ddl?

589


Do you know what is blocking?

635


What is ms sql server service broker?

584






Why variables called the most powerful component of ssis?

692


What is a trigger and its types?

635


Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .

1579


What are different types of schemas?

603


How to delete all rows with truncate table statement in ms sql server?

577


Does group by sort data?

594


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?

600


What is isnull() operator?

683


How to remove duplicate rows from table?

711


When cursors are useful?

654