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
In which sql server version report builder introduced?
How to count groups returned with the group by clause in ms sql server?
Explain the database you used in your final year project?
List the different normalization forms?
How to concatenate two binary strings together?
Explain what is meant by replication of database?
List the data types available in mssql?
Call by value and call by reference in procedure and function, with NOCOPY.
How to get @@error and @@rowcount at the same time?
Can you explain what is sql server english query?
How to change the system date and time from SQL Plus Terminal ?
What is indexing a document?
Explain syntax for dropping triggers?
Explain some stored procedure creating best practices or guidelines?
What are the basic functions for master, msdb, model, tempdb databases?