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

from the table display the 2nd highest salary?
and also the least 2nd salay?

Answer Posted / prasanthi

Query for Getting 2nd least salary (replace 2 with any
number so that you will get any least salary:

select max(Salary) from Employee
where Salary in
(select distinct top 2 Salary from dbo.Employee order by
Salary asc)

Query for Getting 2nd Height salary (replace 2 with any
number so that you will get any least salary:

select min(Salary) from Employee
where Salary in
(select distinct top 2 Salary from dbo.Employee order by
Employee desc)

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 meaning of sql server?

936


What is a periodical index?

864


What is for xml in sql server?

979


What are Row versions of DataRow?

978


Explain full-text query in sql server?

953


What are magic tables in sql server?

1071


When would you prefer to have a minimum number of indexes?

843


Do you know what are acid properties?

1018


What are the different editions available in sql server 2000?

995


What’s the use of custom fields in report?

892


Who is the owner of a schema in ms sql server?

1011


How do you create a clustered index?

1000


How can you control the amount of free space in your index pages?

1012


How to move database physical files in ms sql server?

961


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

954