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 / bobby

select p.emp_id,p.name,p.salary from
( select emp_id,name,salary,dense_rank()over( order by
salary desc)rank
from empTable )p
where rank=2

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different SQL Server Versions you have worked on?

1060


Which sql server is best?

1050


How to insert multiple rows with a subquery?

1190


What is the New in SQL server 2008?

1017


What is the federation in sql azure?

97


Can group functions be used in the order by clause in ms sql server?

1067


What is public role in sql server?

1214


When would you use an insert into .. Select option versus an insert into .. Values option? Give an example of each?

1167


What is the recursive stored procedure in sql server?

1079


What is an example of a foreign key?

1033


What are database states in ms sql server?

1246


Do you know what is sql service broker?

1163


What are the rendering extensions of ssrs?

160


What is dimension table? : sql server analysis services, ssas

1066


Explain timestamp datatype?

1022