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

Explain throw statement in sql server 2008?

1012


What are the different authentication modes in sql server? How can it be changed?

1104


How to end a stored procedure properly in ms sql server?

1103


What is nonclustered index on computed columns?

968


What is the difference function and stored procedure?

1072


Ms sql server index?

1070


How do I view a stored procedure in sql server query?

940


How to create a dml trigger using create trigger statements?

1046


How to assign null values to variables or columns?

989


What is sql injection? How to protect against sql injection attack?

1006


what is the Ticketing tool used in Wipro technologies at Bangalore...???

8162


What is the difference between cube operator and rollup operator? : SQL Server Architecture

1131


What is scheduled job and how to create it?

1011


Why use stored procedures in sql server?

1028


What are temporal tables in sql server 2016?

894