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 / pankaj arya

select top 1 sal from emp where empid in(select top 2 empid
from emp order by sal desc) order by
sal asc

if you want to get 3rd one than put 'top 3' in subquery and
same for 4th, 5th....

Is This Answer Correct ?    15 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the critical issues you have resloved in your company

1963


How can you know if the row fetched from cursor is still valid in underlying table?

998


you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration

1081


How can we determine what objects a user-defined function depends upon?

1014


Explain triggers?

1006


What are extended events in sql server?

955


What is a trigger and types of a trigger?

983


Is ssrs support other database except ms sql server?

139


What is tempdb in sql server?

974


What is sql collation?

1210


Can another user execute your local temporary stored procedures?

987


How to get the definition of a user defined function back?

1044


How many types of triggers in sql server?

1031


List some major differences between triggers and stored procedures?

932


What is the difference between drop table and truncate table?

924