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 are scalar functions?

1051


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

2076


Explain the use of keyword with encryption. Create a store procedure with encryption?

1007


How to update values in a table with update statements in ms sql server?

1061


How you would rewrite the sql query to return the customerid sorted numerically?

1046


How dts is used to extract, transform and consolidate data?

1114


How to test odbc dsn connection settings?

1086


What is side by side migration in sql server?

1170


What is store procedure? When do you use?

986


What are tables in sql server?

1097


What are the key configuration files for sql server reporting services ?

171


What is table constraint?

1052


What are points to remember while using the fillfactor argument?

1018


Tell me the difference between clustered and non-clustered index?

989


How to override dml statements with triggers?

1274