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
how to trace the traffic hitting a sql server? : Sql server database administration
Define right outer join?
Explain security with sql azure?
What is a database table?
Do you know what is xpath?
What programming language would you use to create embedded functions in ssrs?
What is the difference between varchar and varchar(max) datatypes?
What is the architecture of ms sql reporting service?
What is delete query?
What are various ways to enhance the ssrs report?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
How display code or Text of Stored Procedure using Sql query in Sql Server ?
How to encrypt data between dialogs?
Why I am getting "the microsoft .net framework 2.0 in not installed" message?
Explain triggers in sql?