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

Will the writetext statement activate a trigger?

1064


What is schemabinding a view?

906


What is the difference between TRUNCATE and DROP?

1108


what is bit datatype? : Sql server database administration

897


How to get a list of columns in a view using the "sp_help" stored procedure?

1022


What is indexing and its types?

1000


How to find which stored procedure is currently running in sql server?

969


What is surrogate key? : sql server analysis services, ssas

1095


What is system stored procedures?

1026


Does sql server use java?

1049


What is an indexing strategy?

990


What causes index fragmentation?

976


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

868


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

942


What are different types of data sources?

995