how to find nth highest salary
Answer Posted / jeevan
CREATE TABLE
[dbo].[Table_1]([ID] [int] NOT NULL,[SAL] [int] NULL)
//N=9
SELECT TOP 1 * FROM dbo.Table_1
WHERE ID NOT IN (SELECT TOP 8/*N-1*/ ID FROM dbo.Table_1
ORDER BY SAL DESC)
ORDER BY SAL DESC
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the recursive stored procedure in sql server?
How to add additional conditions in SQL?
How can change procedure in sql server?
What is microsoft sql server?
What are the database roles? : sql server security
what is a deadlock? : Sql server database administration
What is change tracking in sql server?
What are scalar functions?
which backup strategy you are following at ur company
Can you insert NULL in unique column?
Explain the concept of recursive stored procedure.
What is tablesample?
What are the disadvantages of using querystrings to send data from one page to another?
Can we use trigger new in before insert?
Equi join and non equi join is possible with sql server?