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 / vishakha shrivastava

for second largest salary
Select * from emp a where 2=(select count(*) from emp b
where a.sal<=b.sal)

Above mentioned query can also be used for 3 ,4 ..n

Select * from emp a where 3=(select count(*) from emp b
where a.sal<=b.sal)

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the New in SQL server 2008?

921


What do I need to start working with sql studio? : sql server management studio

1053


What happens if an integer is too big for int date type?

922


What is store procedure? When do you use?

873


What is row_number()?

935


How to declare a cursor with "declare ... Cursor" in ms sql server?

982


Explain “not null constraint” in sql server?

958


Is it true that rules do not apply to data already existing in a database at the time the rule is created?

990


on line cluster can we make if yes tell me the procedure

1979


How to convert character strings into numeric values?

1036


Can a database be shrunk with users active?

1065


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

915


What is implicit mode in sql server?

1030


How to use subqueries in the from clause in ms sql server?

1104


Explain trigger classes i.e. Instead of and after trigger?

826