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 the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database

plz mail the answer @ mak2786@gmail.com

Answer Posted / g

TO FIND THE 3rd,

select max(sal) from emptable where salary not in(select
distinct top 2 sal from emptable)

TO FIND THE 4th,

select max(sal) from emptable where salary not in(select
distinct top 3 sal from emptable)

TO FIND THE 5th,

select max(sal) from emptable where salary not in(select
distinct top 4 sal from emptable)

keep change top value...

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to see existing views in ms sql server?

1044


What are system databases into sql server (2005/2008)?

999


Can you explain what are various ways to enhance the ssrs report?

1002


Explain boyce and codd normal form(bcnf)?

958


What is executereader?

952


What is report subscription?

125


what is a check constraint?

1122


What are transactions in sql?

1061


What is a non clustered primary key?

925


Tell me what is the stuff and how does it differ from the replace function?

981


How to enable/disable indexes?

1068


What is the use of @@spid?

1001


What is save transaction and save point?

1202


What is the command used to check locks in microsoft sql server?

1044


do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration

988