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

Describe and explain about SQL native client?

1088


What is GUID in sql server?

1145


What factors you will consider calculating the storage requirement for that view?

934


How do I debug a stored procedure in sql server?

1080


We need to perform what steps in the following order to work with a cursor?

1204


Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?

980


What do you mean by an execution plan?

1093


What is bcp? When does it use?

918


What are the options which must be set to allow the usage of optimistic models?

946


Do I need a report server to run reports in my application?

163


What is 1nf 2nf and 3nf?

877


What are the differences between decimal and float in ms sql server?

1206


What is 3nf normalization form?

1084


What is the Control Flow in SSIS

1073


What are four major operators that can be used to combine conditions on a where clause?

1025