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

Describe different Processing Modes offered by SSRS?

252


What is amo? : sql server analysis services, ssas

1096


Write a SQL queries on Self Join and Inner Join.

1051


Explain what is the main purpose of having conversation group?

947


What are the characteristics of modern DBMS?

1094


What are the different types of columns types constraints in the sql server?

1086


How many columns can we include on clustered index ?

998


Explain Reporting Life Cycle?

132


What to perform pattern match with the like operator?

889


what are the disadvantages of cursors? : Sql server database administration

1034


How to define the name and server for a new dsn?

1127


Is sql server 2016 free?

950


What is the difference between ddl,dml and dcl commands?

1121


What are the methods used to protect against sql injection attack?

1074


Do you know what is rank function?

1082