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 / prasant palo

with ttble as
(
select top 3 empid,empname,empsalary
from
emptable
order by empsalary desc
)
-- above will create a common table expression with name
--ttable
-- to know about it search for commontable expression
select top 1 empid,empname,empsalary
from
ttable
order by empsalary asc

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain trigger and trigger types?

932


What is ddl command?

944


How will you find out if there are expensive SQL statements running or not?

987


Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?

983


Explain the functionalities that views support?

1068


What is policy management?

965


What is the difference between for trigger and after trigger?

1056


Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

1025


Is ssrs support other database except ms sql server?

133


How to create “dependant” parameter “make, model, year”

126


How to find table changes in sql server?

1079


can an automatic recovery be initiated by a user? : Sql server administration

922


What is the syntax to execute the sys.dm_db_missing_index_details?

990


Does an index slow down updates on indexed columns?

939


Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?

1037