Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

In which sql server version report builder introduced?

150


How to count groups returned with the group by clause in ms sql server?

1065


Explain the database you used in your final year project?

1045


List the different normalization forms?

985


How to concatenate two binary strings together?

1130


Explain what is meant by replication of database?

1034


List the data types available in mssql?

1035


Call by value and call by reference in procedure and function, with NOCOPY.

1306


How to get @@error and @@rowcount at the same time?

1035


Can you explain what is sql server english query?

997


How to change the system date and time from SQL Plus Terminal ?

1223


What is indexing a document?

1034


Explain syntax for dropping triggers?

934


Explain some stored procedure creating best practices or guidelines?

937


What are the basic functions for master, msdb, model, tempdb databases?

1047