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...

1. How to fetch all the duplicate records from the table.

2. How to fetch the second highest salary from the table.

Answer Posted / saradhi

How to fetch the second highest salary from the table.
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 (n is always greater than one)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default value of an integer data type in sql server 2005?

956


What is the difference between truncate and delete commands?

1071


How can a user-defined datatype be created?

992


What is the use of stored procedure?

943


What purpose does the model database server?

1103


what's the difference between delete table and truncate table commands? : Sql server database administration

989


What are the tool windows in sql server management studio? : sql server management studio

1083


Explain the xml support sql server extends?

1045


What is @@error in sql?

1072


What is the Difference Between Primary and Foreign Key?

1013


Explain system scalar functions?

1004


What are examples of triggers?

1088


What happens if null values are involved in comparison operations?

983


How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication

1082


What happens if we shrink log file in sql server?

985