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

Explain microsoft sql server functions?

1108


What is a unique key constraint?

1028


What is checkpoint process in the sql server?

1030


How to drop an existing table with "drop table" statements in ms sql server?

1086


Is sql server 2016 free?

935


How to enter unicode character string literals in ms sql server?

1072


Scalability, Availability, Integration with internet, etc.)?

2878


What happens if date-only values are provided as date and time literals?

1022


What is primary key, unique key, and foreign key?

976


Explain different types of Normalization.

1831


What is use of except clause?

1092


How you can find out if an index is useful to the optimizer?

939


What is an example of a foreign key?

975


What is difference between stored procedure and user defined function?

1104


What is compression - row-level and page-level compression?

918